{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 十分钟入门pandas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "#coding:utf8\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "这个一篇针对pandas新手的简短入门，想要了解更多复杂的内容，参阅[*Cookbook*](http://pandas.pydata.org/pandas-docs/stable/cookbook.html#cookbook)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通常，我们首先要导入以下几个库："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 创建对象"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过传递一个list来创建**Series**，pandas会默认创建整型索引："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    1.0\n",
       "1    3.0\n",
       "2    5.0\n",
       "3    NaN\n",
       "4    6.0\n",
       "5    8.0\n",
       "dtype: float64"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([1,3,5,np.nan,6,8])\n",
    "s"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过传递一个numpy array，日期索引以及列标签来创建一个**DataFrame**："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04',\n",
       "               '2013-01-05', '2013-01-06'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dates = pd.date_range('20130101', periods=6)\n",
    "dates"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.randn(6,4), index=dates, columns=list('ABCD'))\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过传递一个能够被转换为类似series的dict对象来创建一个**DataFrame**:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>E</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3</td>\n",
       "      <td>test</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3</td>\n",
       "      <td>train</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3</td>\n",
       "      <td>test</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1.0</td>\n",
       "      <td>2013-01-02</td>\n",
       "      <td>1.0</td>\n",
       "      <td>3</td>\n",
       "      <td>train</td>\n",
       "      <td>foo</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A          B    C  D      E    F\n",
       "0  1.0 2013-01-02  1.0  3   test  foo\n",
       "1  1.0 2013-01-02  1.0  3  train  foo\n",
       "2  1.0 2013-01-02  1.0  3   test  foo\n",
       "3  1.0 2013-01-02  1.0  3  train  foo"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = pd.DataFrame({ 'A' : 1.,\n",
    "                     'B' : pd.Timestamp('20130102'),\n",
    "                     'C' : pd.Series(1,index=list(range(4)),dtype='float32'),\n",
    "                     'D' : np.array([3]*4,dtype='int32'),\n",
    "                     'E' : pd.Categorical([\"test\",\"train\",\"test\",\"train\"]),\n",
    "                     'F' : 'foo' })\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "可以看到各列的数据类型为："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A           float64\n",
       "B    datetime64[ns]\n",
       "C           float32\n",
       "D             int32\n",
       "E          category\n",
       "F            object\n",
       "dtype: object"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2.dtypes"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 查看数据"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "查看frame中头部和尾部的几行："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.tail(3)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "显示索引、列名以及底层的numpy数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2013-01-01', '2013-01-02', '2013-01-03', '2013-01-04',\n",
       "               '2013-01-05', '2013-01-06'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.index"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Index(['A', 'B', 'C', 'D'], dtype='object')"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.columns"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([[-0.90052384, -0.30251543, -0.54176245,  1.56291588],\n",
       "       [-0.8841172 , -0.65074073,  0.21734508,  0.26891483],\n",
       "       [ 0.22082238,  0.79052719,  0.69217223,  0.72344092],\n",
       "       [ 1.2602764 ,  1.0002968 ,  0.80980141, -0.38971272],\n",
       "       [ 1.67938067,  1.46860938,  0.36064787, -0.24084994],\n",
       "       [ 0.56786654,  0.23535244,  1.117395  , -0.60432593]])"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.values"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "describe()能对数据做一个快速统计汇总"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>count</th>\n",
       "      <td>6.000000</td>\n",
       "      <td>6.000000</td>\n",
       "      <td>6.000000</td>\n",
       "      <td>6.000000</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>mean</th>\n",
       "      <td>0.323951</td>\n",
       "      <td>0.423588</td>\n",
       "      <td>0.442600</td>\n",
       "      <td>0.220064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>std</th>\n",
       "      <td>1.071708</td>\n",
       "      <td>0.809463</td>\n",
       "      <td>0.579465</td>\n",
       "      <td>0.815219</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>min</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25%</th>\n",
       "      <td>-0.607882</td>\n",
       "      <td>-0.168048</td>\n",
       "      <td>0.253171</td>\n",
       "      <td>-0.352497</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>50%</th>\n",
       "      <td>0.394344</td>\n",
       "      <td>0.512940</td>\n",
       "      <td>0.526410</td>\n",
       "      <td>0.014032</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75%</th>\n",
       "      <td>1.087174</td>\n",
       "      <td>0.947854</td>\n",
       "      <td>0.780394</td>\n",
       "      <td>0.609809</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>max</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "              A         B         C         D\n",
       "count  6.000000  6.000000  6.000000  6.000000\n",
       "mean   0.323951  0.423588  0.442600  0.220064\n",
       "std    1.071708  0.809463  0.579465  0.815219\n",
       "min   -0.900524 -0.650741 -0.541762 -0.604326\n",
       "25%   -0.607882 -0.168048  0.253171 -0.352497\n",
       "50%    0.394344  0.512940  0.526410  0.014032\n",
       "75%    1.087174  0.947854  0.780394  0.609809\n",
       "max    1.679381  1.468609  1.117395  1.562916"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.describe()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对数据做转置："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>2013-01-01 00:00:00</th>\n",
       "      <th>2013-01-02 00:00:00</th>\n",
       "      <th>2013-01-03 00:00:00</th>\n",
       "      <th>2013-01-04 00:00:00</th>\n",
       "      <th>2013-01-05 00:00:00</th>\n",
       "      <th>2013-01-06 00:00:00</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.884117</td>\n",
       "      <td>0.220822</td>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.679381</td>\n",
       "      <td>0.567867</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.235352</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>-0.541762</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>1.117395</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>D</th>\n",
       "      <td>1.562916</td>\n",
       "      <td>0.268915</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>-0.389713</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   2013-01-01  2013-01-02  2013-01-03  2013-01-04  2013-01-05  2013-01-06\n",
       "A   -0.900524   -0.884117    0.220822    1.260276    1.679381    0.567867\n",
       "B   -0.302515   -0.650741    0.790527    1.000297    1.468609    0.235352\n",
       "C   -0.541762    0.217345    0.692172    0.809801    0.360648    1.117395\n",
       "D    1.562916    0.268915    0.723441   -0.389713   -0.240850   -0.604326"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.T"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "按轴进行排序："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>D</th>\n",
       "      <th>C</th>\n",
       "      <th>B</th>\n",
       "      <th>A</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>1.562916</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.900524</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>0.268915</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>-0.884117</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.723441</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.220822</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>-0.389713</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>1.260276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>-0.240850</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>1.679381</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>-0.604326</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>0.567867</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   D         C         B         A\n",
       "2013-01-01  1.562916 -0.541762 -0.302515 -0.900524\n",
       "2013-01-02  0.268915  0.217345 -0.650741 -0.884117\n",
       "2013-01-03  0.723441  0.692172  0.790527  0.220822\n",
       "2013-01-04 -0.389713  0.809801  1.000297  1.260276\n",
       "2013-01-05 -0.240850  0.360648  1.468609  1.679381\n",
       "2013-01-06 -0.604326  1.117395  0.235352  0.567867"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_index(axis=1, ascending=False)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "按值进行排序 :"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_values(by='B')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 数据选择"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "注意：虽然标准的Python/Numpy的表达式能完成选择与赋值等功能，但我们仍推荐使用优化过的pandas数据访问方法：.at，.iat，.loc，.iloc和.ix"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 选取"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "选择某一列数据，它会返回一个**Series**，等同于**df.A**："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2013-01-01   -0.900524\n",
       "2013-01-02   -0.884117\n",
       "2013-01-03    0.220822\n",
       "2013-01-04    1.260276\n",
       "2013-01-05    1.679381\n",
       "2013-01-06    0.567867\n",
       "Freq: D, Name: A, dtype: float64"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['A']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过使用**[ ]**进行切片选取："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[0:3]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['20130102':'20130104']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 通过标签选取"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过标签进行交叉选取："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A   -0.900524\n",
       "B   -0.302515\n",
       "C   -0.541762\n",
       "D    1.562916\n",
       "Name: 2013-01-01 00:00:00, dtype: float64"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[dates[0]]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "使用标签对多个轴进行选取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B\n",
       "2013-01-01 -0.900524 -0.302515\n",
       "2013-01-02 -0.884117 -0.650741\n",
       "2013-01-03  0.220822  0.790527\n",
       "2013-01-04  1.260276  1.000297\n",
       "2013-01-05  1.679381  1.468609\n",
       "2013-01-06  0.567867  0.235352"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[:,['A','B']]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B\n",
       "2013-01-01 -0.900524 -0.302515\n",
       "2013-01-02 -0.884117 -0.650741\n",
       "2013-01-03  0.220822  0.790527"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[:,['A','B']][:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "进行标签切片，包含两个端点"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B\n",
       "2013-01-02 -0.884117 -0.650741\n",
       "2013-01-03  0.220822  0.790527\n",
       "2013-01-04  1.260276  1.000297"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc['20130102':'20130104',['A','B']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于返回的对象进行降维处理"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A   -0.884117\n",
       "B   -0.650741\n",
       "Name: 2013-01-02 00:00:00, dtype: float64"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc['20130102',['A','B']]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "获取一个标量"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.9005238449408509"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[dates[0],'A']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "快速获取标量（与上面的方法等价）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.9005238449408509"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.at[dates[0],'A']"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 通过位置选取"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过传递整型的位置进行选取"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    1.260276\n",
       "B    1.000297\n",
       "C    0.809801\n",
       "D   -0.389713\n",
       "Name: 2013-01-04 00:00:00, dtype: float64"
      ]
     },
     "execution_count": 27,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过整型的位置切片进行选取，与python/numpy形式相同"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B\n",
       "2013-01-04  1.260276  1.000297\n",
       "2013-01-05  1.679381  1.468609"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[3:5,0:2]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "只对行进行切片"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441"
      ]
     },
     "execution_count": 29,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[1:3,:]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "只对列进行切片"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   B         C\n",
       "2013-01-01 -0.302515 -0.541762\n",
       "2013-01-02 -0.650741  0.217345\n",
       "2013-01-03  0.790527  0.692172\n",
       "2013-01-04  1.000297  0.809801\n",
       "2013-01-05  1.468609  0.360648\n",
       "2013-01-06  0.235352  1.117395"
      ]
     },
     "execution_count": 30,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[:,1:3]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "只获取某个值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.6507407272837356"
      ]
     },
     "execution_count": 31,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[1,1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "快速获取某个值（与上面的方法等价）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "-0.6507407272837356"
      ]
     },
     "execution_count": 32,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iat[1,1]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 布尔索引"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用某列的值来选取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326"
      ]
     },
     "execution_count": 33,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df.A > 0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用**where**操作来选取数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.562916</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D\n",
       "2013-01-01       NaN       NaN       NaN  1.562916\n",
       "2013-01-02       NaN       NaN  0.217345  0.268915\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441\n",
       "2013-01-04  1.260276  1.000297  0.809801       NaN\n",
       "2013-01-05  1.679381  1.468609  0.360648       NaN\n",
       "2013-01-06  0.567867  0.235352  1.117395       NaN"
      ]
     },
     "execution_count": 34,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[df > 0]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "用**isin()**方法来过滤数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 35,
   "metadata": {},
   "outputs": [],
   "source": [
    "df2 = df.copy()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "      <td>one</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "      <td>one</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>two</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "      <td>three</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>four</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "      <td>three</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D      E\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916    one\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915    one\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441    two\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713  three\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850   four\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326  three"
      ]
     },
     "execution_count": 36,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2['E'] = ['one', 'one', 'two', 'three', 'four', 'three']\n",
    "df2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>two</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>four</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D     E\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441   two\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850  four"
      ]
     },
     "execution_count": 37,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2[df2['E'].isin(['two', 'four'])]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 赋值"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "赋值一个新的列，通过索引来自动对齐数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2013-01-02    1\n",
       "2013-01-03    2\n",
       "2013-01-04    3\n",
       "2013-01-05    4\n",
       "2013-01-06    5\n",
       "2013-01-07    6\n",
       "Freq: D, dtype: int64"
      ]
     },
     "execution_count": 38,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1 = pd.Series([1,2,3,4,5,6], index=pd.date_range('20130102',periods=6))\n",
    "s1"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>-0.900524</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D    F\n",
       "2013-01-01 -0.900524 -0.302515 -0.541762  1.562916  NaN\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441  2.0\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713  3.0\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850  4.0\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326  5.0"
      ]
     },
     "execution_count": 39,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df['F'] = s1\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过标签赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.302515</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D    F\n",
       "2013-01-01  0.000000 -0.302515 -0.541762  1.562916  NaN\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441  2.0\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713  3.0\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850  4.0\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326  5.0"
      ]
     },
     "execution_count": 40,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.at[dates[0], 'A'] = 0\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过位置赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>1.562916</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>0.268915</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>0.723441</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>-0.389713</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>-0.240850</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>-0.604326</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C         D    F\n",
       "2013-01-01  0.000000  0.000000 -0.541762  1.562916  NaN\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  0.268915  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  0.723441  2.0\n",
       "2013-01-04  1.260276  1.000297  0.809801 -0.389713  3.0\n",
       "2013-01-05  1.679381  1.468609  0.360648 -0.240850  4.0\n",
       "2013-01-06  0.567867  0.235352  1.117395 -0.604326  5.0"
      ]
     },
     "execution_count": 41,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iat[0,1] = 0\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过传递numpy array赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>5</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>1.679381</td>\n",
       "      <td>1.468609</td>\n",
       "      <td>0.360648</td>\n",
       "      <td>5</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>0.567867</td>\n",
       "      <td>0.235352</td>\n",
       "      <td>1.117395</td>\n",
       "      <td>5</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C  D    F\n",
       "2013-01-01  0.000000  0.000000 -0.541762  5  NaN\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  5  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  5  2.0\n",
       "2013-01-04  1.260276  1.000297  0.809801  5  3.0\n",
       "2013-01-05  1.679381  1.468609  0.360648  5  4.0\n",
       "2013-01-06  0.567867  0.235352  1.117395  5  5.0"
      ]
     },
     "execution_count": 42,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[:,'D'] = np.array([5] * len(df))\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过**where**操作来赋值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>-5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>-0.217345</td>\n",
       "      <td>-5</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>-0.220822</td>\n",
       "      <td>-0.790527</td>\n",
       "      <td>-0.692172</td>\n",
       "      <td>-5</td>\n",
       "      <td>-2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>-1.260276</td>\n",
       "      <td>-1.000297</td>\n",
       "      <td>-0.809801</td>\n",
       "      <td>-5</td>\n",
       "      <td>-3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>-1.679381</td>\n",
       "      <td>-1.468609</td>\n",
       "      <td>-0.360648</td>\n",
       "      <td>-5</td>\n",
       "      <td>-4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>-0.567867</td>\n",
       "      <td>-0.235352</td>\n",
       "      <td>-1.117395</td>\n",
       "      <td>-5</td>\n",
       "      <td>-5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C  D    F\n",
       "2013-01-01  0.000000  0.000000 -0.541762 -5  NaN\n",
       "2013-01-02 -0.884117 -0.650741 -0.217345 -5 -1.0\n",
       "2013-01-03 -0.220822 -0.790527 -0.692172 -5 -2.0\n",
       "2013-01-04 -1.260276 -1.000297 -0.809801 -5 -3.0\n",
       "2013-01-05 -1.679381 -1.468609 -0.360648 -5 -4.0\n",
       "2013-01-06 -0.567867 -0.235352 -1.117395 -5 -5.0"
      ]
     },
     "execution_count": 43,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = df.copy()\n",
    "df2[df2 > 0] = -df2\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 缺失值处理"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "在pandas中，用**np.nan**来代表缺失值，这些值默认不会参与运算。\n",
    "\n",
    "reindex()允许你修改、增加、删除指定轴上的索引，并返回一个数据副本。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C  D    F    E\n",
       "2013-01-01  0.000000  0.000000 -0.541762  5  NaN  1.0\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  5  1.0  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  5  2.0  NaN\n",
       "2013-01-04  1.260276  1.000297  0.809801  5  3.0  NaN"
      ]
     },
     "execution_count": 44,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1 = df.reindex(index=dates[0:4], columns=list(df.columns)+['E'])\n",
    "df1.loc[dates[0]:dates[1],'E'] = 1\n",
    "df1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "剔除所有包含缺失值的行数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C  D    F    E\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  5  1.0  1.0"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.dropna(how='any')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "填充缺失值"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>5</td>\n",
       "      <td>5.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>0.217345</td>\n",
       "      <td>5</td>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>0.220822</td>\n",
       "      <td>0.790527</td>\n",
       "      <td>0.692172</td>\n",
       "      <td>5</td>\n",
       "      <td>2.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>1.260276</td>\n",
       "      <td>1.000297</td>\n",
       "      <td>0.809801</td>\n",
       "      <td>5</td>\n",
       "      <td>3.0</td>\n",
       "      <td>5.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C  D    F    E\n",
       "2013-01-01  0.000000  0.000000 -0.541762  5  5.0  1.0\n",
       "2013-01-02 -0.884117 -0.650741  0.217345  5  1.0  1.0\n",
       "2013-01-03  0.220822  0.790527  0.692172  5  2.0  5.0\n",
       "2013-01-04  1.260276  1.000297  0.809801  5  3.0  5.0"
      ]
     },
     "execution_count": 46,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df1.fillna(value=5)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "获取值是否为**nan**的布尔标记"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>False</td>\n",
       "      <td>True</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                A      B      C      D      F      E\n",
       "2013-01-01  False  False  False  False   True  False\n",
       "2013-01-02  False  False  False  False  False  False\n",
       "2013-01-03  False  False  False  False  False   True\n",
       "2013-01-04  False  False  False  False  False   True"
      ]
     },
     "execution_count": 47,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.isnull(df1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 运算"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 统计"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "运算过程中，通常不包含缺失值。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "进行描述性统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    0.474038\n",
       "B    0.474008\n",
       "C    0.442600\n",
       "D    5.000000\n",
       "F    3.000000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 48,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对其他轴进行同样的运算"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2013-01-01    1.114559\n",
       "2013-01-02    0.936497\n",
       "2013-01-03    1.740704\n",
       "2013-01-04    2.214075\n",
       "2013-01-05    2.501728\n",
       "2013-01-06    2.384123\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.mean(1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于拥有不同维度的对象进行运算时需要对齐。除此之外，pandas会自动沿着指定维度计算。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2013-01-01    NaN\n",
       "2013-01-02    NaN\n",
       "2013-01-03    1.0\n",
       "2013-01-04    3.0\n",
       "2013-01-05    5.0\n",
       "2013-01-06    NaN\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 50,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series([1,3,5,np.nan,6,8], index=dates).shift(2)\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>-0.779178</td>\n",
       "      <td>-0.209473</td>\n",
       "      <td>-0.307828</td>\n",
       "      <td>4.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>-1.739724</td>\n",
       "      <td>-1.999703</td>\n",
       "      <td>-2.190199</td>\n",
       "      <td>2.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>-3.320619</td>\n",
       "      <td>-3.531391</td>\n",
       "      <td>-4.639352</td>\n",
       "      <td>0.0</td>\n",
       "      <td>-1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C    D    F\n",
       "2013-01-01       NaN       NaN       NaN  NaN  NaN\n",
       "2013-01-02       NaN       NaN       NaN  NaN  NaN\n",
       "2013-01-03 -0.779178 -0.209473 -0.307828  4.0  1.0\n",
       "2013-01-04 -1.739724 -1.999703 -2.190199  2.0  0.0\n",
       "2013-01-05 -3.320619 -3.531391 -4.639352  0.0 -1.0\n",
       "2013-01-06       NaN       NaN       NaN  NaN  NaN"
      ]
     },
     "execution_count": 51,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sub(s, axis='index')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Apply 函数作用"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过apply()对函数作用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>F</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2013-01-01</th>\n",
       "      <td>0.000000</td>\n",
       "      <td>0.000000</td>\n",
       "      <td>-0.541762</td>\n",
       "      <td>5</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-02</th>\n",
       "      <td>-0.884117</td>\n",
       "      <td>-0.650741</td>\n",
       "      <td>-0.324417</td>\n",
       "      <td>10</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-03</th>\n",
       "      <td>-0.663295</td>\n",
       "      <td>0.139786</td>\n",
       "      <td>0.367755</td>\n",
       "      <td>15</td>\n",
       "      <td>3.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-04</th>\n",
       "      <td>0.596982</td>\n",
       "      <td>1.140083</td>\n",
       "      <td>1.177556</td>\n",
       "      <td>20</td>\n",
       "      <td>6.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-05</th>\n",
       "      <td>2.276362</td>\n",
       "      <td>2.608693</td>\n",
       "      <td>1.538204</td>\n",
       "      <td>25</td>\n",
       "      <td>10.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2013-01-06</th>\n",
       "      <td>2.844229</td>\n",
       "      <td>2.844045</td>\n",
       "      <td>2.655599</td>\n",
       "      <td>30</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A         B         C   D     F\n",
       "2013-01-01  0.000000  0.000000 -0.541762   5   NaN\n",
       "2013-01-02 -0.884117 -0.650741 -0.324417  10   1.0\n",
       "2013-01-03 -0.663295  0.139786  0.367755  15   3.0\n",
       "2013-01-04  0.596982  1.140083  1.177556  20   6.0\n",
       "2013-01-05  2.276362  2.608693  1.538204  25  10.0\n",
       "2013-01-06  2.844229  2.844045  2.655599  30  15.0"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.apply(np.cumsum)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    2.563498\n",
       "B    2.119350\n",
       "C    1.659157\n",
       "D    0.000000\n",
       "F    4.000000\n",
       "dtype: float64"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.apply(lambda x:x.max()-x.min())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 频数统计"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    2\n",
       "1    0\n",
       "2    5\n",
       "3    1\n",
       "4    6\n",
       "5    1\n",
       "6    1\n",
       "7    1\n",
       "8    5\n",
       "9    4\n",
       "dtype: int32"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series(np.random.randint(0, 7, size=10))\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1    4\n",
       "5    2\n",
       "6    1\n",
       "4    1\n",
       "2    1\n",
       "0    1\n",
       "dtype: int64"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s.value_counts()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 字符串方法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于Series对象，在其str属性中有着一系列的字符串处理方法。就如同下段代码一样，能很方便的对array中各个元素进行运算。值得注意的是，在str属性中的模式匹配默认使用正则表达式。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0       a\n",
       "1       b\n",
       "2       c\n",
       "3    aaba\n",
       "4    baca\n",
       "5     NaN\n",
       "6    caba\n",
       "7     dog\n",
       "8     cat\n",
       "dtype: object"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = pd.Series(['A', 'B', 'C', 'Aaba', 'Baca', np.nan, 'CABA', 'dog', 'cat'])\n",
    "s.str.lower()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 合并"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Concat 连接"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pandas中提供了大量的方法能够轻松对Series，DataFrame和Panel对象进行不同满足逻辑关系的合并操作"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "通过**concat()**来连接pandas对象"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.560690</td>\n",
       "      <td>2.253479</td>\n",
       "      <td>1.728586</td>\n",
       "      <td>1.224112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-1.237557</td>\n",
       "      <td>-1.571768</td>\n",
       "      <td>-1.687004</td>\n",
       "      <td>-0.226474</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.591146</td>\n",
       "      <td>-0.054644</td>\n",
       "      <td>0.600806</td>\n",
       "      <td>0.076132</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.567678</td>\n",
       "      <td>0.426496</td>\n",
       "      <td>-0.972487</td>\n",
       "      <td>0.200211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-2.073311</td>\n",
       "      <td>-1.566767</td>\n",
       "      <td>-0.533602</td>\n",
       "      <td>1.366468</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2.244767</td>\n",
       "      <td>1.612232</td>\n",
       "      <td>1.934717</td>\n",
       "      <td>-0.403805</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-2.640917</td>\n",
       "      <td>0.640549</td>\n",
       "      <td>1.257238</td>\n",
       "      <td>0.043773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1.545405</td>\n",
       "      <td>1.771884</td>\n",
       "      <td>-0.273687</td>\n",
       "      <td>2.441483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.440476</td>\n",
       "      <td>0.567536</td>\n",
       "      <td>2.379072</td>\n",
       "      <td>1.152354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.047853</td>\n",
       "      <td>-0.440427</td>\n",
       "      <td>-1.382389</td>\n",
       "      <td>0.647217</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3\n",
       "0  1.560690  2.253479  1.728586  1.224112\n",
       "1 -1.237557 -1.571768 -1.687004 -0.226474\n",
       "2 -0.591146 -0.054644  0.600806  0.076132\n",
       "3 -0.567678  0.426496 -0.972487  0.200211\n",
       "4 -2.073311 -1.566767 -0.533602  1.366468\n",
       "5  2.244767  1.612232  1.934717 -0.403805\n",
       "6 -2.640917  0.640549  1.257238  0.043773\n",
       "7  1.545405  1.771884 -0.273687  2.441483\n",
       "8 -0.440476  0.567536  2.379072  1.152354\n",
       "9 -0.047853 -0.440427 -1.382389  0.647217"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.randn(10,4))\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[          0         1         2         3\n",
       " 0  1.560690  2.253479  1.728586  1.224112\n",
       " 1 -1.237557 -1.571768 -1.687004 -0.226474\n",
       " 2 -0.591146 -0.054644  0.600806  0.076132,\n",
       "           0         1         2         3\n",
       " 3 -0.567678  0.426496 -0.972487  0.200211\n",
       " 4 -2.073311 -1.566767 -0.533602  1.366468\n",
       " 5  2.244767  1.612232  1.934717 -0.403805\n",
       " 6 -2.640917  0.640549  1.257238  0.043773,\n",
       "           0         1         2         3\n",
       " 7  1.545405  1.771884 -0.273687  2.441483\n",
       " 8 -0.440476  0.567536  2.379072  1.152354\n",
       " 9 -0.047853 -0.440427 -1.382389  0.647217]"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#break it into pieces\n",
    "pieces = [df[:3], df[3:7], df[7:]]\n",
    "pieces"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1.560690</td>\n",
       "      <td>2.253479</td>\n",
       "      <td>1.728586</td>\n",
       "      <td>1.224112</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-1.237557</td>\n",
       "      <td>-1.571768</td>\n",
       "      <td>-1.687004</td>\n",
       "      <td>-0.226474</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.591146</td>\n",
       "      <td>-0.054644</td>\n",
       "      <td>0.600806</td>\n",
       "      <td>0.076132</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>-0.567678</td>\n",
       "      <td>0.426496</td>\n",
       "      <td>-0.972487</td>\n",
       "      <td>0.200211</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-2.073311</td>\n",
       "      <td>-1.566767</td>\n",
       "      <td>-0.533602</td>\n",
       "      <td>1.366468</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2.244767</td>\n",
       "      <td>1.612232</td>\n",
       "      <td>1.934717</td>\n",
       "      <td>-0.403805</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-2.640917</td>\n",
       "      <td>0.640549</td>\n",
       "      <td>1.257238</td>\n",
       "      <td>0.043773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>1.545405</td>\n",
       "      <td>1.771884</td>\n",
       "      <td>-0.273687</td>\n",
       "      <td>2.441483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>-0.440476</td>\n",
       "      <td>0.567536</td>\n",
       "      <td>2.379072</td>\n",
       "      <td>1.152354</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>-0.047853</td>\n",
       "      <td>-0.440427</td>\n",
       "      <td>-1.382389</td>\n",
       "      <td>0.647217</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          0         1         2         3\n",
       "0  1.560690  2.253479  1.728586  1.224112\n",
       "1 -1.237557 -1.571768 -1.687004 -0.226474\n",
       "2 -0.591146 -0.054644  0.600806  0.076132\n",
       "3 -0.567678  0.426496 -0.972487  0.200211\n",
       "4 -2.073311 -1.566767 -0.533602  1.366468\n",
       "5  2.244767  1.612232  1.934717 -0.403805\n",
       "6 -2.640917  0.640549  1.257238  0.043773\n",
       "7  1.545405  1.771884 -0.273687  2.441483\n",
       "8 -0.440476  0.567536  2.379072  1.152354\n",
       "9 -0.047853 -0.440427 -1.382389  0.647217"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.concat(pieces)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Join 合并"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "类似于SQL中的合并(merge)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>key</th>\n",
       "      <th>lval</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>foo</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>foo</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   key  lval\n",
       "0  foo     1\n",
       "1  foo     2"
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "left = pd.DataFrame({'key':['foo', 'foo'], 'lval':[1,2]})\n",
    "left"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>key</th>\n",
       "      <th>lval</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>foo</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>foo</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   key  lval\n",
       "0  foo     4\n",
       "1  foo     5"
      ]
     },
     "execution_count": 61,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "right = pd.DataFrame({'key':['foo', 'foo'], 'lval':[4,5]})\n",
    "right"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>key</th>\n",
       "      <th>lval_x</th>\n",
       "      <th>lval_y</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>foo</td>\n",
       "      <td>1</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>foo</td>\n",
       "      <td>1</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>foo</td>\n",
       "      <td>2</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>foo</td>\n",
       "      <td>2</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   key  lval_x  lval_y\n",
       "0  foo       1       4\n",
       "1  foo       1       5\n",
       "2  foo       2       4\n",
       "3  foo       2       5"
      ]
     },
     "execution_count": 62,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.merge(left, right, on='key')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Append 添加"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "将若干行添加到dataFrame后面"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.415810</td>\n",
       "      <td>-1.106857</td>\n",
       "      <td>-0.687920</td>\n",
       "      <td>2.422911</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.696149</td>\n",
       "      <td>-1.235975</td>\n",
       "      <td>0.201409</td>\n",
       "      <td>1.424596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.540622</td>\n",
       "      <td>0.121096</td>\n",
       "      <td>-0.861667</td>\n",
       "      <td>-0.171690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.163904</td>\n",
       "      <td>1.324567</td>\n",
       "      <td>-0.768324</td>\n",
       "      <td>-0.205520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-1.581152</td>\n",
       "      <td>-0.079061</td>\n",
       "      <td>0.251810</td>\n",
       "      <td>-0.195755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.254246</td>\n",
       "      <td>1.604556</td>\n",
       "      <td>0.766464</td>\n",
       "      <td>-1.090743</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.608609</td>\n",
       "      <td>1.000765</td>\n",
       "      <td>-0.407980</td>\n",
       "      <td>0.034970</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-3.111914</td>\n",
       "      <td>2.163344</td>\n",
       "      <td>0.619885</td>\n",
       "      <td>-0.705518</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          A         B         C         D\n",
       "0  0.415810 -1.106857 -0.687920  2.422911\n",
       "1  0.696149 -1.235975  0.201409  1.424596\n",
       "2 -0.540622  0.121096 -0.861667 -0.171690\n",
       "3  0.163904  1.324567 -0.768324 -0.205520\n",
       "4 -1.581152 -0.079061  0.251810 -0.195755\n",
       "5  1.254246  1.604556  0.766464 -1.090743\n",
       "6  0.608609  1.000765 -0.407980  0.034970\n",
       "7 -3.111914  2.163344  0.619885 -0.705518"
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.randn(8, 4), columns=['A', 'B', 'C', 'D'])\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "A    0.163904\n",
       "B    1.324567\n",
       "C   -0.768324\n",
       "D   -0.205520\n",
       "Name: 3, dtype: float64"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s = df.iloc[3]\n",
    "s"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.415810</td>\n",
       "      <td>-1.106857</td>\n",
       "      <td>-0.687920</td>\n",
       "      <td>2.422911</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.696149</td>\n",
       "      <td>-1.235975</td>\n",
       "      <td>0.201409</td>\n",
       "      <td>1.424596</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>-0.540622</td>\n",
       "      <td>0.121096</td>\n",
       "      <td>-0.861667</td>\n",
       "      <td>-0.171690</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.163904</td>\n",
       "      <td>1.324567</td>\n",
       "      <td>-0.768324</td>\n",
       "      <td>-0.205520</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>-1.581152</td>\n",
       "      <td>-0.079061</td>\n",
       "      <td>0.251810</td>\n",
       "      <td>-0.195755</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>1.254246</td>\n",
       "      <td>1.604556</td>\n",
       "      <td>0.766464</td>\n",
       "      <td>-1.090743</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.608609</td>\n",
       "      <td>1.000765</td>\n",
       "      <td>-0.407980</td>\n",
       "      <td>0.034970</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>-3.111914</td>\n",
       "      <td>2.163344</td>\n",
       "      <td>0.619885</td>\n",
       "      <td>-0.705518</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.163904</td>\n",
       "      <td>1.324567</td>\n",
       "      <td>-0.768324</td>\n",
       "      <td>-0.205520</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          A         B         C         D\n",
       "0  0.415810 -1.106857 -0.687920  2.422911\n",
       "1  0.696149 -1.235975  0.201409  1.424596\n",
       "2 -0.540622  0.121096 -0.861667 -0.171690\n",
       "3  0.163904  1.324567 -0.768324 -0.205520\n",
       "4 -1.581152 -0.079061  0.251810 -0.195755\n",
       "5  1.254246  1.604556  0.766464 -1.090743\n",
       "6  0.608609  1.000765 -0.407980  0.034970\n",
       "7 -3.111914  2.163344  0.619885 -0.705518\n",
       "8  0.163904  1.324567 -0.768324 -0.205520"
      ]
     },
     "execution_count": 65,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.append(s, ignore_index=True)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 分组"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于“group by”操作，我们通常是指以下一个或几个步骤：\n",
    "* **划分** 按照某些标准将数据分为不同的组\n",
    "* **应用** 对每组数据分别执行一个函数\n",
    "* **组合** 将结果组合到一个数据结构"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>foo</td>\n",
       "      <td>one</td>\n",
       "      <td>0.190663</td>\n",
       "      <td>0.589384</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>bar</td>\n",
       "      <td>one</td>\n",
       "      <td>1.056331</td>\n",
       "      <td>0.035044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>foo</td>\n",
       "      <td>two</td>\n",
       "      <td>0.723645</td>\n",
       "      <td>0.372672</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>bar</td>\n",
       "      <td>three</td>\n",
       "      <td>-1.306869</td>\n",
       "      <td>0.435296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>foo</td>\n",
       "      <td>two</td>\n",
       "      <td>0.673661</td>\n",
       "      <td>-1.292242</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>bar</td>\n",
       "      <td>two</td>\n",
       "      <td>-0.823728</td>\n",
       "      <td>0.837556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>foo</td>\n",
       "      <td>one</td>\n",
       "      <td>0.638573</td>\n",
       "      <td>2.453041</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>bar</td>\n",
       "      <td>three</td>\n",
       "      <td>0.508922</td>\n",
       "      <td>0.578740</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     A      B         C         D\n",
       "0  foo    one  0.190663  0.589384\n",
       "1  bar    one  1.056331  0.035044\n",
       "2  foo    two  0.723645  0.372672\n",
       "3  bar  three -1.306869  0.435296\n",
       "4  foo    two  0.673661 -1.292242\n",
       "5  bar    two -0.823728  0.837556\n",
       "6  foo    one  0.638573  2.453041\n",
       "7  bar  three  0.508922  0.578740"
      ]
     },
     "execution_count": 66,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'A' : ['foo', 'bar', 'foo', 'bar', \n",
    "                          'foo', 'bar', 'foo', 'bar'],\n",
    "                   'B' : ['one', 'one', 'two', 'three', \n",
    "                          'two', 'two', 'one', 'three'],\n",
    "                   'C' : np.random.randn(8),\n",
    "                   'D' : np.random.randn(8)})\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "分组并对每个分组应用sum函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>bar</th>\n",
       "      <td>-0.565344</td>\n",
       "      <td>1.886637</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>foo</th>\n",
       "      <td>2.226542</td>\n",
       "      <td>2.122855</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "            C         D\n",
       "A                      \n",
       "bar -0.565344  1.886637\n",
       "foo  2.226542  2.122855"
      ]
     },
     "execution_count": 67,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby('A').sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "按多个列分组形成层级索引，然后应用函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">bar</th>\n",
       "      <th>one</th>\n",
       "      <td>1.056331</td>\n",
       "      <td>0.035044</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>three</th>\n",
       "      <td>-0.797947</td>\n",
       "      <td>1.014036</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>-0.823728</td>\n",
       "      <td>0.837556</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">foo</th>\n",
       "      <th>one</th>\n",
       "      <td>0.829236</td>\n",
       "      <td>3.042425</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>1.397306</td>\n",
       "      <td>-0.919570</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                  C         D\n",
       "A   B                        \n",
       "bar one    1.056331  0.035044\n",
       "    three -0.797947  1.014036\n",
       "    two   -0.823728  0.837556\n",
       "foo one    0.829236  3.042425\n",
       "    two    1.397306 -0.919570"
      ]
     },
     "execution_count": 68,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(['A','B']).sum()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 变形"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 堆叠"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 69,
   "metadata": {},
   "outputs": [],
   "source": [
    "tuples = list(zip(*[['bar', 'bar', 'baz', 'baz',\n",
    "                     'foo', 'foo', 'qux', 'qux'],\n",
    "                    ['one', 'two', 'one', 'two',\n",
    "                     'one', 'two', 'one', 'two']]))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 70,
   "metadata": {},
   "outputs": [],
   "source": [
    "index = pd.MultiIndex.from_tuples(tuples, names=['first', 'second'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 71,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.DataFrame(np.random.randn(8, 2), index=index, columns=['A', 'B'])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 72,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>first</th>\n",
       "      <th>second</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">bar</th>\n",
       "      <th>one</th>\n",
       "      <td>-0.551894</td>\n",
       "      <td>0.358046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>-0.773283</td>\n",
       "      <td>-0.489393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">baz</th>\n",
       "      <th>one</th>\n",
       "      <td>-0.461588</td>\n",
       "      <td>-1.561085</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>2.304456</td>\n",
       "      <td>-0.241811</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     A         B\n",
       "first second                    \n",
       "bar   one    -0.551894  0.358046\n",
       "      two    -0.773283 -0.489393\n",
       "baz   one    -0.461588 -1.561085\n",
       "      two     2.304456 -0.241811"
      ]
     },
     "execution_count": 72,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df2 = df[:4]\n",
    "df2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "**stack()**方法对DataFrame的列“压缩”一个层级"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 73,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "first  second   \n",
       "bar    one     A   -0.551894\n",
       "               B    0.358046\n",
       "       two     A   -0.773283\n",
       "               B   -0.489393\n",
       "baz    one     A   -0.461588\n",
       "               B   -1.561085\n",
       "       two     A    2.304456\n",
       "               B   -0.241811\n",
       "dtype: float64"
      ]
     },
     "execution_count": 73,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stacked = df2.stack()\n",
    "stacked"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于一个“堆叠过的”DataFrame或者Series（拥有MultiIndex作为索引），**stack()**的逆操作是**unstack()**，默认反堆叠到上一个层级"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 74,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>first</th>\n",
       "      <th>second</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">bar</th>\n",
       "      <th>one</th>\n",
       "      <td>-0.551894</td>\n",
       "      <td>0.358046</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>-0.773283</td>\n",
       "      <td>-0.489393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">baz</th>\n",
       "      <th>one</th>\n",
       "      <td>-0.461588</td>\n",
       "      <td>-1.561085</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>two</th>\n",
       "      <td>2.304456</td>\n",
       "      <td>-0.241811</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                     A         B\n",
       "first second                    \n",
       "bar   one    -0.551894  0.358046\n",
       "      two    -0.773283 -0.489393\n",
       "baz   one    -0.461588 -1.561085\n",
       "      two     2.304456 -0.241811"
      ]
     },
     "execution_count": 74,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stacked.unstack()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 75,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>second</th>\n",
       "      <th>one</th>\n",
       "      <th>two</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>first</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">bar</th>\n",
       "      <th>A</th>\n",
       "      <td>-0.551894</td>\n",
       "      <td>-0.773283</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.358046</td>\n",
       "      <td>-0.489393</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">baz</th>\n",
       "      <th>A</th>\n",
       "      <td>-0.461588</td>\n",
       "      <td>2.304456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>-1.561085</td>\n",
       "      <td>-0.241811</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "second        one       two\n",
       "first                      \n",
       "bar   A -0.551894 -0.773283\n",
       "      B  0.358046 -0.489393\n",
       "baz   A -0.461588  2.304456\n",
       "      B -1.561085 -0.241811"
      ]
     },
     "execution_count": 75,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stacked.unstack(1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 76,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>first</th>\n",
       "      <th>bar</th>\n",
       "      <th>baz</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>second</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">one</th>\n",
       "      <th>A</th>\n",
       "      <td>-0.551894</td>\n",
       "      <td>-0.461588</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.358046</td>\n",
       "      <td>-1.561085</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"2\" valign=\"top\">two</th>\n",
       "      <th>A</th>\n",
       "      <td>-0.773283</td>\n",
       "      <td>2.304456</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>-0.489393</td>\n",
       "      <td>-0.241811</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "first          bar       baz\n",
       "second                      \n",
       "one    A -0.551894 -0.461588\n",
       "       B  0.358046 -1.561085\n",
       "two    A -0.773283  2.304456\n",
       "       B -0.489393 -0.241811"
      ]
     },
     "execution_count": 76,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stacked.unstack(0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 数据透视表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 77,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "      <th>E</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>one</td>\n",
       "      <td>A</td>\n",
       "      <td>foo</td>\n",
       "      <td>-0.169373</td>\n",
       "      <td>-1.070179</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>one</td>\n",
       "      <td>B</td>\n",
       "      <td>foo</td>\n",
       "      <td>-0.484603</td>\n",
       "      <td>-1.627113</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>two</td>\n",
       "      <td>C</td>\n",
       "      <td>foo</td>\n",
       "      <td>-1.289207</td>\n",
       "      <td>0.635274</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>three</td>\n",
       "      <td>A</td>\n",
       "      <td>bar</td>\n",
       "      <td>0.034032</td>\n",
       "      <td>-0.553259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>one</td>\n",
       "      <td>B</td>\n",
       "      <td>bar</td>\n",
       "      <td>0.536531</td>\n",
       "      <td>-0.088784</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>one</td>\n",
       "      <td>C</td>\n",
       "      <td>bar</td>\n",
       "      <td>-0.977931</td>\n",
       "      <td>-0.211193</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>two</td>\n",
       "      <td>A</td>\n",
       "      <td>foo</td>\n",
       "      <td>1.486196</td>\n",
       "      <td>-0.377266</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>three</td>\n",
       "      <td>B</td>\n",
       "      <td>foo</td>\n",
       "      <td>-1.108725</td>\n",
       "      <td>0.050407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>one</td>\n",
       "      <td>C</td>\n",
       "      <td>foo</td>\n",
       "      <td>0.562988</td>\n",
       "      <td>-0.195356</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>one</td>\n",
       "      <td>A</td>\n",
       "      <td>bar</td>\n",
       "      <td>0.510381</td>\n",
       "      <td>-2.050069</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>two</td>\n",
       "      <td>B</td>\n",
       "      <td>bar</td>\n",
       "      <td>0.005697</td>\n",
       "      <td>0.708523</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>three</td>\n",
       "      <td>C</td>\n",
       "      <td>bar</td>\n",
       "      <td>0.942276</td>\n",
       "      <td>0.769442</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "        A  B    C         D         E\n",
       "0     one  A  foo -0.169373 -1.070179\n",
       "1     one  B  foo -0.484603 -1.627113\n",
       "2     two  C  foo -1.289207  0.635274\n",
       "3   three  A  bar  0.034032 -0.553259\n",
       "4     one  B  bar  0.536531 -0.088784\n",
       "5     one  C  bar -0.977931 -0.211193\n",
       "6     two  A  foo  1.486196 -0.377266\n",
       "7   three  B  foo -1.108725  0.050407\n",
       "8     one  C  foo  0.562988 -0.195356\n",
       "9     one  A  bar  0.510381 -2.050069\n",
       "10    two  B  bar  0.005697  0.708523\n",
       "11  three  C  bar  0.942276  0.769442"
      ]
     },
     "execution_count": 77,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({'A' : ['one', 'one', 'two', 'three'] * 3,\n",
    "                   'B' : ['A', 'B', 'C'] * 4,\n",
    "                   'C' : ['foo', 'foo', 'foo', 'bar', 'bar', 'bar'] * 2,\n",
    "                   'D' : np.random.randn(12),\n",
    "                   'E' : np.random.randn(12)})\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " 我们可以轻松地从这个数据得到透视表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 78,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>C</th>\n",
       "      <th>bar</th>\n",
       "      <th>foo</th>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th></th>\n",
       "      <th></th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">one</th>\n",
       "      <th>A</th>\n",
       "      <td>0.510381</td>\n",
       "      <td>-0.169373</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.536531</td>\n",
       "      <td>-0.484603</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>-0.977931</td>\n",
       "      <td>0.562988</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">three</th>\n",
       "      <th>A</th>\n",
       "      <td>0.034032</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.108725</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>0.942276</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th rowspan=\"3\" valign=\"top\">two</th>\n",
       "      <th>A</th>\n",
       "      <td>NaN</td>\n",
       "      <td>1.486196</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>B</th>\n",
       "      <td>0.005697</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>C</th>\n",
       "      <td>NaN</td>\n",
       "      <td>-1.289207</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "C             bar       foo\n",
       "A     B                    \n",
       "one   A  0.510381 -0.169373\n",
       "      B  0.536531 -0.484603\n",
       "      C -0.977931  0.562988\n",
       "three A  0.034032       NaN\n",
       "      B       NaN -1.108725\n",
       "      C  0.942276       NaN\n",
       "two   A       NaN  1.486196\n",
       "      B  0.005697       NaN\n",
       "      C       NaN -1.289207"
      ]
     },
     "execution_count": 78,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.pivot_table(df, values='D', index=['A', 'B'], columns=['C'])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 时间序列"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "pandas在对频率转换进行重新采样时拥有着简单，强大而且高效的功能（例如把按秒采样的数据转换为按5分钟采样的数据）。这在金融领域很常见，但又不限于此。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-01-01 00:00:00', '2012-01-01 00:00:01',\n",
       "               '2012-01-01 00:00:02', '2012-01-01 00:00:03',\n",
       "               '2012-01-01 00:00:04', '2012-01-01 00:00:05',\n",
       "               '2012-01-01 00:00:06', '2012-01-01 00:00:07',\n",
       "               '2012-01-01 00:00:08', '2012-01-01 00:00:09',\n",
       "               '2012-01-01 00:00:10', '2012-01-01 00:00:11',\n",
       "               '2012-01-01 00:00:12', '2012-01-01 00:00:13',\n",
       "               '2012-01-01 00:00:14', '2012-01-01 00:00:15',\n",
       "               '2012-01-01 00:00:16', '2012-01-01 00:00:17',\n",
       "               '2012-01-01 00:00:18', '2012-01-01 00:00:19',\n",
       "               '2012-01-01 00:00:20', '2012-01-01 00:00:21',\n",
       "               '2012-01-01 00:00:22', '2012-01-01 00:00:23',\n",
       "               '2012-01-01 00:00:24', '2012-01-01 00:00:25',\n",
       "               '2012-01-01 00:00:26', '2012-01-01 00:00:27',\n",
       "               '2012-01-01 00:00:28', '2012-01-01 00:00:29',\n",
       "               '2012-01-01 00:00:30', '2012-01-01 00:00:31',\n",
       "               '2012-01-01 00:00:32', '2012-01-01 00:00:33',\n",
       "               '2012-01-01 00:00:34', '2012-01-01 00:00:35',\n",
       "               '2012-01-01 00:00:36', '2012-01-01 00:00:37',\n",
       "               '2012-01-01 00:00:38', '2012-01-01 00:00:39',\n",
       "               '2012-01-01 00:00:40', '2012-01-01 00:00:41',\n",
       "               '2012-01-01 00:00:42', '2012-01-01 00:00:43',\n",
       "               '2012-01-01 00:00:44', '2012-01-01 00:00:45',\n",
       "               '2012-01-01 00:00:46', '2012-01-01 00:00:47',\n",
       "               '2012-01-01 00:00:48', '2012-01-01 00:00:49',\n",
       "               '2012-01-01 00:00:50', '2012-01-01 00:00:51',\n",
       "               '2012-01-01 00:00:52', '2012-01-01 00:00:53',\n",
       "               '2012-01-01 00:00:54', '2012-01-01 00:00:55',\n",
       "               '2012-01-01 00:00:56', '2012-01-01 00:00:57',\n",
       "               '2012-01-01 00:00:58', '2012-01-01 00:00:59',\n",
       "               '2012-01-01 00:01:00', '2012-01-01 00:01:01',\n",
       "               '2012-01-01 00:01:02', '2012-01-01 00:01:03',\n",
       "               '2012-01-01 00:01:04', '2012-01-01 00:01:05',\n",
       "               '2012-01-01 00:01:06', '2012-01-01 00:01:07',\n",
       "               '2012-01-01 00:01:08', '2012-01-01 00:01:09',\n",
       "               '2012-01-01 00:01:10', '2012-01-01 00:01:11',\n",
       "               '2012-01-01 00:01:12', '2012-01-01 00:01:13',\n",
       "               '2012-01-01 00:01:14', '2012-01-01 00:01:15',\n",
       "               '2012-01-01 00:01:16', '2012-01-01 00:01:17',\n",
       "               '2012-01-01 00:01:18', '2012-01-01 00:01:19',\n",
       "               '2012-01-01 00:01:20', '2012-01-01 00:01:21',\n",
       "               '2012-01-01 00:01:22', '2012-01-01 00:01:23',\n",
       "               '2012-01-01 00:01:24', '2012-01-01 00:01:25',\n",
       "               '2012-01-01 00:01:26', '2012-01-01 00:01:27',\n",
       "               '2012-01-01 00:01:28', '2012-01-01 00:01:29',\n",
       "               '2012-01-01 00:01:30', '2012-01-01 00:01:31',\n",
       "               '2012-01-01 00:01:32', '2012-01-01 00:01:33',\n",
       "               '2012-01-01 00:01:34', '2012-01-01 00:01:35',\n",
       "               '2012-01-01 00:01:36', '2012-01-01 00:01:37',\n",
       "               '2012-01-01 00:01:38', '2012-01-01 00:01:39'],\n",
       "              dtype='datetime64[ns]', freq='S')"
      ]
     },
     "execution_count": 79,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2012', periods=100, freq='S')\n",
    "rng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-01-01 00:00:00    100\n",
       "2012-01-01 00:00:01     47\n",
       "2012-01-01 00:00:02    473\n",
       "2012-01-01 00:00:03    136\n",
       "2012-01-01 00:00:04    192\n",
       "2012-01-01 00:00:05    372\n",
       "2012-01-01 00:00:06    459\n",
       "2012-01-01 00:00:07    450\n",
       "2012-01-01 00:00:08    244\n",
       "2012-01-01 00:00:09    383\n",
       "2012-01-01 00:00:10    250\n",
       "2012-01-01 00:00:11     53\n",
       "2012-01-01 00:00:12    364\n",
       "2012-01-01 00:00:13    139\n",
       "2012-01-01 00:00:14    239\n",
       "2012-01-01 00:00:15    494\n",
       "2012-01-01 00:00:16    370\n",
       "2012-01-01 00:00:17    329\n",
       "2012-01-01 00:00:18     48\n",
       "2012-01-01 00:00:19    278\n",
       "2012-01-01 00:00:20    100\n",
       "2012-01-01 00:00:21    443\n",
       "2012-01-01 00:00:22    348\n",
       "2012-01-01 00:00:23     25\n",
       "2012-01-01 00:00:24    257\n",
       "2012-01-01 00:00:25    245\n",
       "2012-01-01 00:00:26     60\n",
       "2012-01-01 00:00:27     12\n",
       "2012-01-01 00:00:28    312\n",
       "2012-01-01 00:00:29    154\n",
       "                      ... \n",
       "2012-01-01 00:01:10     31\n",
       "2012-01-01 00:01:11    225\n",
       "2012-01-01 00:01:12    364\n",
       "2012-01-01 00:01:13    171\n",
       "2012-01-01 00:01:14    351\n",
       "2012-01-01 00:01:15    459\n",
       "2012-01-01 00:01:16    363\n",
       "2012-01-01 00:01:17    369\n",
       "2012-01-01 00:01:18    421\n",
       "2012-01-01 00:01:19    389\n",
       "2012-01-01 00:01:20    408\n",
       "2012-01-01 00:01:21     63\n",
       "2012-01-01 00:01:22     55\n",
       "2012-01-01 00:01:23    368\n",
       "2012-01-01 00:01:24    439\n",
       "2012-01-01 00:01:25     14\n",
       "2012-01-01 00:01:26    220\n",
       "2012-01-01 00:01:27    250\n",
       "2012-01-01 00:01:28    495\n",
       "2012-01-01 00:01:29    391\n",
       "2012-01-01 00:01:30     79\n",
       "2012-01-01 00:01:31    408\n",
       "2012-01-01 00:01:32    232\n",
       "2012-01-01 00:01:33    413\n",
       "2012-01-01 00:01:34    373\n",
       "2012-01-01 00:01:35    355\n",
       "2012-01-01 00:01:36    308\n",
       "2012-01-01 00:01:37     51\n",
       "2012-01-01 00:01:38    375\n",
       "2012-01-01 00:01:39    185\n",
       "Freq: S, Length: 100, dtype: int32"
      ]
     },
     "execution_count": 80,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = pd.Series(np.random.randint(0,500,len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\ProgramData\\Anaconda3\\lib\\site-packages\\ipykernel_launcher.py:1: FutureWarning: how in .resample() is deprecated\n",
      "the new syntax is .resample(...).sum()\n",
      "  \"\"\"Entry point for launching an IPython kernel.\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "2012-01-01    26203\n",
       "Freq: 5T, dtype: int32"
      ]
     },
     "execution_count": 81,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.resample('5Min', how='sum')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "时区表示"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-03-06', '2012-03-07', '2012-03-08', '2012-03-09',\n",
       "               '2012-03-10'],\n",
       "              dtype='datetime64[ns]', freq='D')"
      ]
     },
     "execution_count": 82,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('3/6/2012', periods=5, freq='D')\n",
    "rng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-06    0.523781\n",
       "2012-03-07   -0.670822\n",
       "2012-03-08    0.934826\n",
       "2012-03-09    0.002239\n",
       "2012-03-10   -0.091952\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 83,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = pd.Series(np.random.randn(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-06 00:00:00+00:00    0.523781\n",
       "2012-03-07 00:00:00+00:00   -0.670822\n",
       "2012-03-08 00:00:00+00:00    0.934826\n",
       "2012-03-09 00:00:00+00:00    0.002239\n",
       "2012-03-10 00:00:00+00:00   -0.091952\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 84,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_utc = ts.tz_localize('UTC')\n",
    "ts_utc"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "时区转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-03-05 19:00:00-05:00    0.523781\n",
       "2012-03-06 19:00:00-05:00   -0.670822\n",
       "2012-03-07 19:00:00-05:00    0.934826\n",
       "2012-03-08 19:00:00-05:00    0.002239\n",
       "2012-03-09 19:00:00-05:00   -0.091952\n",
       "Freq: D, dtype: float64"
      ]
     },
     "execution_count": 85,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts_utc.tz_convert('US/Eastern')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "时间跨度转换"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "DatetimeIndex(['2012-01-31', '2012-02-29', '2012-03-31', '2012-04-30',\n",
       "               '2012-05-31'],\n",
       "              dtype='datetime64[ns]', freq='M')"
      ]
     },
     "execution_count": 86,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "rng = pd.date_range('1/1/2012', periods=5, freq='M')\n",
    "rng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-01-31    1.296132\n",
       "2012-02-29    1.023936\n",
       "2012-03-31   -0.249774\n",
       "2012-04-30    1.007810\n",
       "2012-05-31   -0.051413\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 87,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = pd.Series(np.random.randn(len(rng)), index=rng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-01    1.296132\n",
       "2012-02    1.023936\n",
       "2012-03   -0.249774\n",
       "2012-04    1.007810\n",
       "2012-05   -0.051413\n",
       "Freq: M, dtype: float64"
      ]
     },
     "execution_count": 88,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ps = ts.to_period()\n",
    "ps"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2012-01-01    1.296132\n",
       "2012-02-01    1.023936\n",
       "2012-03-01   -0.249774\n",
       "2012-04-01    1.007810\n",
       "2012-05-01   -0.051413\n",
       "Freq: MS, dtype: float64"
      ]
     },
     "execution_count": 89,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ps.to_timestamp()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "日期与时间戳之间的转换使得可以使用一些方便的算术函数。例如，我们把以11月为年底的季度数据转换为当前季度末月底为始的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "PeriodIndex(['1990Q1', '1990Q2', '1990Q3', '1990Q4', '1991Q1', '1991Q2',\n",
       "             '1991Q3', '1991Q4', '1992Q1', '1992Q2', '1992Q3', '1992Q4',\n",
       "             '1993Q1', '1993Q2', '1993Q3', '1993Q4', '1994Q1', '1994Q2',\n",
       "             '1994Q3', '1994Q4', '1995Q1', '1995Q2', '1995Q3', '1995Q4',\n",
       "             '1996Q1', '1996Q2', '1996Q3', '1996Q4', '1997Q1', '1997Q2',\n",
       "             '1997Q3', '1997Q4', '1998Q1', '1998Q2', '1998Q3', '1998Q4',\n",
       "             '1999Q1', '1999Q2', '1999Q3', '1999Q4', '2000Q1', '2000Q2',\n",
       "             '2000Q3', '2000Q4'],\n",
       "            dtype='period[Q-NOV]', freq='Q-NOV')"
      ]
     },
     "execution_count": 90,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "prng = pd.period_range('1990Q1', '2000Q4', freq='Q-NOV')\n",
    "prng"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 91,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1990Q1    0.467059\n",
       "1990Q2   -0.745741\n",
       "1990Q3    0.106234\n",
       "1990Q4   -0.306761\n",
       "1991Q1   -2.012034\n",
       "1991Q2   -2.033417\n",
       "1991Q3   -1.116709\n",
       "1991Q4    0.031495\n",
       "1992Q1    0.407074\n",
       "1992Q2    0.988878\n",
       "1992Q3   -0.195428\n",
       "1992Q4   -0.144770\n",
       "1993Q1    0.733104\n",
       "1993Q2   -0.742351\n",
       "1993Q3   -0.464713\n",
       "1993Q4   -1.247317\n",
       "1994Q1   -0.108473\n",
       "1994Q2    0.188728\n",
       "1994Q3    0.052446\n",
       "1994Q4   -0.004046\n",
       "1995Q1    1.075490\n",
       "1995Q2   -0.436009\n",
       "1995Q3    0.747165\n",
       "1995Q4    2.433366\n",
       "1996Q1   -0.471832\n",
       "1996Q2   -1.337675\n",
       "1996Q3    0.931348\n",
       "1996Q4   -0.461312\n",
       "1997Q1    0.041943\n",
       "1997Q2   -1.003802\n",
       "1997Q3   -0.572660\n",
       "1997Q4   -0.959966\n",
       "1998Q1   -1.864559\n",
       "1998Q2   -2.196461\n",
       "1998Q3   -1.317999\n",
       "1998Q4   -0.796643\n",
       "1999Q1    1.183292\n",
       "1999Q2   -0.046480\n",
       "1999Q3   -0.727018\n",
       "1999Q4   -0.972557\n",
       "2000Q1    0.541060\n",
       "2000Q2    1.221401\n",
       "2000Q3   -1.407534\n",
       "2000Q4   -0.773754\n",
       "Freq: Q-NOV, dtype: float64"
      ]
     },
     "execution_count": 91,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts = pd.Series(np.random.randn(len(prng)), index = prng)\n",
    "ts"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 92,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1990-02-01 09:00    0.467059\n",
       "1990-05-01 09:00   -0.745741\n",
       "1990-08-01 09:00    0.106234\n",
       "1990-11-01 09:00   -0.306761\n",
       "1991-02-01 09:00   -2.012034\n",
       "1991-05-01 09:00   -2.033417\n",
       "1991-08-01 09:00   -1.116709\n",
       "1991-11-01 09:00    0.031495\n",
       "1992-02-01 09:00    0.407074\n",
       "1992-05-01 09:00    0.988878\n",
       "1992-08-01 09:00   -0.195428\n",
       "1992-11-01 09:00   -0.144770\n",
       "1993-02-01 09:00    0.733104\n",
       "1993-05-01 09:00   -0.742351\n",
       "1993-08-01 09:00   -0.464713\n",
       "1993-11-01 09:00   -1.247317\n",
       "1994-02-01 09:00   -0.108473\n",
       "1994-05-01 09:00    0.188728\n",
       "1994-08-01 09:00    0.052446\n",
       "1994-11-01 09:00   -0.004046\n",
       "1995-02-01 09:00    1.075490\n",
       "1995-05-01 09:00   -0.436009\n",
       "1995-08-01 09:00    0.747165\n",
       "1995-11-01 09:00    2.433366\n",
       "1996-02-01 09:00   -0.471832\n",
       "1996-05-01 09:00   -1.337675\n",
       "1996-08-01 09:00    0.931348\n",
       "1996-11-01 09:00   -0.461312\n",
       "1997-02-01 09:00    0.041943\n",
       "1997-05-01 09:00   -1.003802\n",
       "1997-08-01 09:00   -0.572660\n",
       "1997-11-01 09:00   -0.959966\n",
       "1998-02-01 09:00   -1.864559\n",
       "1998-05-01 09:00   -2.196461\n",
       "1998-08-01 09:00   -1.317999\n",
       "1998-11-01 09:00   -0.796643\n",
       "1999-02-01 09:00    1.183292\n",
       "1999-05-01 09:00   -0.046480\n",
       "1999-08-01 09:00   -0.727018\n",
       "1999-11-01 09:00   -0.972557\n",
       "2000-02-01 09:00    0.541060\n",
       "2000-05-01 09:00    1.221401\n",
       "2000-08-01 09:00   -1.407534\n",
       "2000-11-01 09:00   -0.773754\n",
       "Freq: H, dtype: float64"
      ]
     },
     "execution_count": 92,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ts.index = (prng.asfreq('M', 'end') ) .asfreq('H', 'start') +9\n",
    "ts"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 分类"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从版本0.15开始，pandas在**DataFrame**中开始包括分类数据。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 93,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>raw_grade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>a</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>e</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>e</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   id raw_grade\n",
       "0   1         a\n",
       "1   2         b\n",
       "2   3         b\n",
       "3   4         a\n",
       "4   5         e\n",
       "5   6         e"
      ]
     },
     "execution_count": 93,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df = pd.DataFrame({\"id\":[1,2,3,4,5,6], \"raw_grade\":['a', 'b', 'b', 'a', 'e', 'e']})\n",
    "df"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "把raw_grade转换为分类类型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 94,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    a\n",
       "1    b\n",
       "2    b\n",
       "3    a\n",
       "4    e\n",
       "5    e\n",
       "Name: grade, dtype: category\n",
       "Categories (3, object): [a, b, e]"
      ]
     },
     "execution_count": 94,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"grade\"] = df[\"raw_grade\"].astype(\"category\")\n",
    "df[\"grade\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "重命名类别名为更有意义的名称"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 95,
   "metadata": {},
   "outputs": [],
   "source": [
    "df[\"grade\"].cat.categories = [\"very good\", \"good\", \"very bad\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对分类重新排序，并添加缺失的分类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0    very good\n",
       "1         good\n",
       "2         good\n",
       "3    very good\n",
       "4     very bad\n",
       "5     very bad\n",
       "Name: grade, dtype: category\n",
       "Categories (5, object): [very bad, bad, medium, good, very good]"
      ]
     },
     "execution_count": 96,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df[\"grade\"] = df[\"grade\"].cat.set_categories([\"very bad\", \"bad\", \"medium\", \"good\", \"very good\"])\n",
    "df[\"grade\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "排序是按照分类的顺序进行的，而不是字典序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>id</th>\n",
       "      <th>raw_grade</th>\n",
       "      <th>grade</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>5</td>\n",
       "      <td>e</td>\n",
       "      <td>very bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>6</td>\n",
       "      <td>e</td>\n",
       "      <td>very bad</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>b</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>3</td>\n",
       "      <td>b</td>\n",
       "      <td>good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>a</td>\n",
       "      <td>very good</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4</td>\n",
       "      <td>a</td>\n",
       "      <td>very good</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   id raw_grade      grade\n",
       "4   5         e   very bad\n",
       "5   6         e   very bad\n",
       "1   2         b       good\n",
       "2   3         b       good\n",
       "0   1         a  very good\n",
       "3   4         a  very good"
      ]
     },
     "execution_count": 97,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.sort_values(by=\"grade\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "按分类分组时，也会显示空的分类"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "grade\n",
       "very bad     2\n",
       "bad          0\n",
       "medium       0\n",
       "good         2\n",
       "very good    2\n",
       "dtype: int64"
      ]
     },
     "execution_count": 98,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.groupby(\"grade\").size()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 绘图"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 99,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.axes._subplots.AxesSubplot at 0x2472e962d68>"
      ]
     },
     "execution_count": 99,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAEHCAYAAAC+1b08AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUe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9aYx/OBfea/eebtvEj9XCPlK1jXz3xsMXAZ8Eqkf66R8BXE/3vTgKnm7TFAFZAb6Z9vJH9FrIeuta7SWn9s3m4GtmPsSrsceMI87QngCvP25cCT2vAhkKuUKgEuBN7SWtdrrY8BbwEXhfFHGZGCeP3QWi8HmsPZ/pEsWNdOa71La73b/D6VQDXGpiQRIVExhq6UmgjMBdYAxVrrKjD+8IBR5mmlwCHb0w6bx/o6LsJkmNdPRFCwrp1S6lQgGXOtt4iMiAd0pVQm8C+MJVNN/Z3q55ju57gIgyBcPxEhwbp25ietp4AbtdbdwW2lGIyIBnSllAPjD+pprfUL5uGj1kdx899q8/hhYJzt6WOByn6OixAL0vUTERCsa6eUygZeBX5sDseICIrkKhcFPAps11rfY3voJcBaqbIEeNF2/EvmjPt8oNH8WPgGcIFSKs+clb/APCZCKIjXT4RZsK6dUioZ+DfG+PrzYWq+6E+kZmOBMzE+tn2CkTNiI8ZsegGwHCNxznIg3zxfAQ9gjNFtBsps3+smYI/5dWOkZ5pHwleQr99KoAZox+gNXhjpny+ev4J17YAvAi7b99gInBTpn28kf8lOUSGEiBMRnxQVQggRHBLQhRAiTkhAF0KIOCEBXQgh4oQEdCGEiBMS0IUQIk5IQBdCiDjx/wESemmq8S5l1QAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x2472e95eef0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000))\n",
    "ts = ts.cumsum()\n",
    "ts.plot()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "对于DataFrame类型，**plot()**能很方便地画出所有列及其标签"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.legend.Legend at 0x247309914e0>"
      ]
     },
     "execution_count": 100,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.figure.Figure at 0x24730a068d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXwAAAEHCAYAAACtAv3IAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4yLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvNQv5yAAAIABJREFUeJzsnXd4FOX2xz+T3nsICQFCF5BeLFgQG2JBrFiu2C5i93rtXa/12rs/sXEtYEFAVES6gqj03kNJCOk92d1smd8f78zObEs2yabBfJ4nz5SdmX2T7J45c95zvkeSZRkDAwMDg6OfoLYegIGBgYFB62AYfAMDA4NjBMPgGxgYGBwjGAbfwMDA4BjBMPgGBgYGxwiGwTcwMDA4RjAMvoGBgcExgmHwDQwMDI4RDINvYGBgcIwQ0tYD0JOSkiJnZWW19TAMDAwMOhTr1q0rlmU5taHj2pXBz8rKYu3atW09DAMDA4MOhSRJB/05zgjpGBgYGBwjGAbfwMDA4BjBMPgGBgYGxwjtKobvDavVSm5uLmazua2H0iARERFkZmYSGhra1kMxMDAw8KDdG/zc3FxiY2PJyspCkqS2Ho5PZFmmpKSE3NxcevTo0dbDMTAwMPAgICEdSZIOSJK0RZKkjZIkrVX2JUmStEiSpD3KMrEp1zabzSQnJ7drYw8gSRLJyckd4knEwMDg2CSQMfwzZFkeKsvySGX7IWCJLMt9gCXKdpNo78ZepaOM06CFkWVw2Nt6FAYGHrTkpO1EYIayPgO4uAXfy8Cg/fDn+/BMEpjK2nokBgYuBMrgy8CvkiStkyRpqrIvTZblIwDKspO3EyVJmipJ0lpJktYWFRUFaDiBZ86cOUiSxM6dO9t6KAa+2L0QfrirrUcBaz4Sy8q8th2HgYEbgTL4Y2RZHg6cB9wuSdJp/p4oy/KHsiyPlGV5ZGpqg5XBbcbMmTM55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SpCpJkqqBpcDsPfhR9js6se+QJOlDoH5PXv/+TGf1nSRJ6yVJ2hA+z06gHDlpy6Cb6NEGX4sQohA4EPgWyJMkqQTkHyeQG25WAGzXHFYc3pZou8EeoIN9Z9CNdFbfCSEmADbCce4G3cNeYfCFEG5gIXJYWF1rTeNsk1rZbtDFdELfGXQTndV34Zna88B5kiSFOvcqDdpDjzf4Qggr8o/uBUmSXg9vLlOm++H/y8Pbi4G+msP7ADtb2W7QhXRS3xl0A53Vd0KIVOAd4Mawu8egG+nRBj8su/oUsEaSpAc0uxYDSqTNOcAizfazw1EDhwK14ann+8BRQoiMcGTBUeFtBl1EJ/adwR6ms/pOCGED3kD277+6hy7foDW6e9W4tX/A4chTw5XIuh0/IkcEZAEfIgsbfQhkhtsL4GFkP+EqYJzmXOcDG8P/zuvuz7av/+vkvvscqACakEeTs7r78+3L/zqr74AzAb/mHD8CY7v78+3P/4xMWwMDA4P9hB7t0jEwMDAw6DwMg29gYGCwn2AYfAMDA4P9BMPgGxgYGOwnGAbfwMDAYD/BMPgGBgYG+wmGwTcwMDDYT/h/STO4oYzxZxwAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x247309911d0>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "df = pd.DataFrame(np.random.randn(1000, 4), index=ts.index, columns=['A', 'B', 'C', 'D'])\n",
    "df = df.cumsum()\n",
    "plt.figure(); df.plot(); plt.legend(loc='best')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 获取数据的I/O"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## CSV"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "写入一个csv文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 101,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_csv('data/foo.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从一个csv文件读入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Unnamed: 0</th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>2000-01-01</td>\n",
       "      <td>-0.547915</td>\n",
       "      <td>0.758504</td>\n",
       "      <td>-0.791553</td>\n",
       "      <td>-0.014276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2000-01-02</td>\n",
       "      <td>-1.478652</td>\n",
       "      <td>-1.824863</td>\n",
       "      <td>0.001416</td>\n",
       "      <td>-1.067864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>2000-01-03</td>\n",
       "      <td>-3.070727</td>\n",
       "      <td>-1.655967</td>\n",
       "      <td>-0.551411</td>\n",
       "      <td>-2.188238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>2000-01-04</td>\n",
       "      <td>-3.317105</td>\n",
       "      <td>-1.810778</td>\n",
       "      <td>0.354000</td>\n",
       "      <td>-1.995760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>2000-01-05</td>\n",
       "      <td>-2.822308</td>\n",
       "      <td>-2.757077</td>\n",
       "      <td>1.210057</td>\n",
       "      <td>-1.250592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>2000-01-06</td>\n",
       "      <td>-2.223865</td>\n",
       "      <td>-3.256931</td>\n",
       "      <td>3.658672</td>\n",
       "      <td>-1.232510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>2000-01-07</td>\n",
       "      <td>-0.559411</td>\n",
       "      <td>-2.842820</td>\n",
       "      <td>4.860993</td>\n",
       "      <td>-0.418853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>2000-01-08</td>\n",
       "      <td>-0.524812</td>\n",
       "      <td>-2.748762</td>\n",
       "      <td>6.280814</td>\n",
       "      <td>0.170616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>2000-01-09</td>\n",
       "      <td>0.204528</td>\n",
       "      <td>-0.865022</td>\n",
       "      <td>5.560456</td>\n",
       "      <td>0.875871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>2000-01-10</td>\n",
       "      <td>0.688895</td>\n",
       "      <td>-1.704024</td>\n",
       "      <td>5.226062</td>\n",
       "      <td>0.444483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>2000-01-11</td>\n",
       "      <td>1.272138</td>\n",
       "      <td>-2.478377</td>\n",
       "      <td>2.763524</td>\n",
       "      <td>-1.229797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>2000-01-12</td>\n",
       "      <td>1.255657</td>\n",
       "      <td>-2.994073</td>\n",
       "      <td>2.869688</td>\n",
       "      <td>0.745504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>2000-01-13</td>\n",
       "      <td>-0.001803</td>\n",
       "      <td>-2.295823</td>\n",
       "      <td>2.738087</td>\n",
       "      <td>2.640307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>2000-01-14</td>\n",
       "      <td>0.144209</td>\n",
       "      <td>-0.926810</td>\n",
       "      <td>4.087308</td>\n",
       "      <td>0.164138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>2000-01-15</td>\n",
       "      <td>1.304811</td>\n",
       "      <td>0.625530</td>\n",
       "      <td>3.542700</td>\n",
       "      <td>-1.499446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>2000-01-16</td>\n",
       "      <td>0.682026</td>\n",
       "      <td>0.552441</td>\n",
       "      <td>3.201389</td>\n",
       "      <td>-0.155674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>2000-01-17</td>\n",
       "      <td>-1.065321</td>\n",
       "      <td>-0.339092</td>\n",
       "      <td>3.792634</td>\n",
       "      <td>-1.754946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>2000-01-18</td>\n",
       "      <td>-1.268418</td>\n",
       "      <td>-3.512773</td>\n",
       "      <td>3.656896</td>\n",
       "      <td>-0.132124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>2000-01-19</td>\n",
       "      <td>-1.936390</td>\n",
       "      <td>-1.069188</td>\n",
       "      <td>2.554887</td>\n",
       "      <td>0.413930</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>2000-01-20</td>\n",
       "      <td>-1.138678</td>\n",
       "      <td>-2.993870</td>\n",
       "      <td>3.094198</td>\n",
       "      <td>-0.956574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>2000-01-21</td>\n",
       "      <td>-0.096721</td>\n",
       "      <td>-4.141108</td>\n",
       "      <td>3.341248</td>\n",
       "      <td>-0.436886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>2000-01-22</td>\n",
       "      <td>-0.678763</td>\n",
       "      <td>-5.012663</td>\n",
       "      <td>0.823576</td>\n",
       "      <td>1.303377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>2000-01-23</td>\n",
       "      <td>-2.498525</td>\n",
       "      <td>-6.075938</td>\n",
       "      <td>0.302908</td>\n",
       "      <td>-0.294204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>2000-01-24</td>\n",
       "      <td>-0.937785</td>\n",
       "      <td>-6.768487</td>\n",
       "      <td>-0.078521</td>\n",
       "      <td>-0.165799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>2000-01-25</td>\n",
       "      <td>-0.252338</td>\n",
       "      <td>-6.882860</td>\n",
       "      <td>0.545684</td>\n",
       "      <td>-1.108641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>2000-01-26</td>\n",
       "      <td>-0.772653</td>\n",
       "      <td>-7.080129</td>\n",
       "      <td>0.764647</td>\n",
       "      <td>-3.041450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>2000-01-27</td>\n",
       "      <td>-0.348831</td>\n",
       "      <td>-6.035375</td>\n",
       "      <td>0.507673</td>\n",
       "      <td>-2.522836</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>2000-01-28</td>\n",
       "      <td>1.751721</td>\n",
       "      <td>-5.756738</td>\n",
       "      <td>-0.469014</td>\n",
       "      <td>-2.825118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>2000-01-29</td>\n",
       "      <td>0.799938</td>\n",
       "      <td>-4.559172</td>\n",
       "      <td>-0.086763</td>\n",
       "      <td>-3.243101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>2000-01-30</td>\n",
       "      <td>1.149650</td>\n",
       "      <td>-4.433331</td>\n",
       "      <td>1.476689</td>\n",
       "      <td>-2.479956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>970</th>\n",
       "      <td>2002-08-28</td>\n",
       "      <td>0.466756</td>\n",
       "      <td>38.780786</td>\n",
       "      <td>-6.743120</td>\n",
       "      <td>-15.206051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>971</th>\n",
       "      <td>2002-08-29</td>\n",
       "      <td>1.903199</td>\n",
       "      <td>36.687258</td>\n",
       "      <td>-5.720742</td>\n",
       "      <td>-14.335689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>972</th>\n",
       "      <td>2002-08-30</td>\n",
       "      <td>1.432801</td>\n",
       "      <td>37.186065</td>\n",
       "      <td>-6.274877</td>\n",
       "      <td>-14.879621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>973</th>\n",
       "      <td>2002-08-31</td>\n",
       "      <td>2.218021</td>\n",
       "      <td>36.200395</td>\n",
       "      <td>-5.638178</td>\n",
       "      <td>-15.625389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>974</th>\n",
       "      <td>2002-09-01</td>\n",
       "      <td>3.405318</td>\n",
       "      <td>36.987365</td>\n",
       "      <td>-4.441912</td>\n",
       "      <td>-14.162031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>975</th>\n",
       "      <td>2002-09-02</td>\n",
       "      <td>3.854252</td>\n",
       "      <td>38.283545</td>\n",
       "      <td>-4.845949</td>\n",
       "      <td>-15.449302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>976</th>\n",
       "      <td>2002-09-03</td>\n",
       "      <td>4.328033</td>\n",
       "      <td>37.123804</td>\n",
       "      <td>-6.006344</td>\n",
       "      <td>-14.158929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>977</th>\n",
       "      <td>2002-09-04</td>\n",
       "      <td>5.219103</td>\n",
       "      <td>37.203486</td>\n",
       "      <td>-6.035182</td>\n",
       "      <td>-14.461389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>978</th>\n",
       "      <td>2002-09-05</td>\n",
       "      <td>4.884547</td>\n",
       "      <td>38.192836</td>\n",
       "      <td>-6.447570</td>\n",
       "      <td>-13.541204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>979</th>\n",
       "      <td>2002-09-06</td>\n",
       "      <td>5.817435</td>\n",
       "      <td>37.669998</td>\n",
       "      <td>-5.983732</td>\n",
       "      <td>-12.238303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>980</th>\n",
       "      <td>2002-09-07</td>\n",
       "      <td>7.953334</td>\n",
       "      <td>37.503576</td>\n",
       "      <td>-4.783659</td>\n",
       "      <td>-12.092902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>981</th>\n",
       "      <td>2002-09-08</td>\n",
       "      <td>8.575181</td>\n",
       "      <td>37.377622</td>\n",
       "      <td>-3.154240</td>\n",
       "      <td>-12.895208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>982</th>\n",
       "      <td>2002-09-09</td>\n",
       "      <td>8.242240</td>\n",
       "      <td>38.155500</td>\n",
       "      <td>-3.285132</td>\n",
       "      <td>-13.483775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>983</th>\n",
       "      <td>2002-09-10</td>\n",
       "      <td>9.699693</td>\n",
       "      <td>37.421024</td>\n",
       "      <td>-1.763105</td>\n",
       "      <td>-13.397276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>984</th>\n",
       "      <td>2002-09-11</td>\n",
       "      <td>7.228027</td>\n",
       "      <td>38.070563</td>\n",
       "      <td>-1.250151</td>\n",
       "      <td>-14.455654</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>985</th>\n",
       "      <td>2002-09-12</td>\n",
       "      <td>7.276336</td>\n",
       "      <td>38.503057</td>\n",
       "      <td>-1.110047</td>\n",
       "      <td>-15.362900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>986</th>\n",
       "      <td>2002-09-13</td>\n",
       "      <td>6.955453</td>\n",
       "      <td>37.038613</td>\n",
       "      <td>-0.571942</td>\n",
       "      <td>-14.527590</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>987</th>\n",
       "      <td>2002-09-14</td>\n",
       "      <td>6.232800</td>\n",
       "      <td>37.254276</td>\n",
       "      <td>-1.893050</td>\n",
       "      <td>-14.385401</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>988</th>\n",
       "      <td>2002-09-15</td>\n",
       "      <td>5.331802</td>\n",
       "      <td>36.671504</td>\n",
       "      <td>-1.782282</td>\n",
       "      <td>-13.645305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>989</th>\n",
       "      <td>2002-09-16</td>\n",
       "      <td>5.825638</td>\n",
       "      <td>36.920733</td>\n",
       "      <td>-2.718137</td>\n",
       "      <td>-13.875984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>990</th>\n",
       "      <td>2002-09-17</td>\n",
       "      <td>5.972137</td>\n",
       "      <td>36.785577</td>\n",
       "      <td>-3.923763</td>\n",
       "      <td>-13.281418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>991</th>\n",
       "      <td>2002-09-18</td>\n",
       "      <td>5.154685</td>\n",
       "      <td>34.789858</td>\n",
       "      <td>-4.426825</td>\n",
       "      <td>-13.805227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>992</th>\n",
       "      <td>2002-09-19</td>\n",
       "      <td>4.228035</td>\n",
       "      <td>34.400350</td>\n",
       "      <td>-4.431980</td>\n",
       "      <td>-14.520423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>993</th>\n",
       "      <td>2002-09-20</td>\n",
       "      <td>3.047640</td>\n",
       "      <td>36.244469</td>\n",
       "      <td>-5.093584</td>\n",
       "      <td>-15.106412</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>994</th>\n",
       "      <td>2002-09-21</td>\n",
       "      <td>2.984361</td>\n",
       "      <td>38.095349</td>\n",
       "      <td>-5.560222</td>\n",
       "      <td>-16.584216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>995</th>\n",
       "      <td>2002-09-22</td>\n",
       "      <td>3.187098</td>\n",
       "      <td>37.169742</td>\n",
       "      <td>-6.132250</td>\n",
       "      <td>-14.910771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>996</th>\n",
       "      <td>2002-09-23</td>\n",
       "      <td>1.772470</td>\n",
       "      <td>36.399488</td>\n",
       "      <td>-6.257600</td>\n",
       "      <td>-13.668261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>997</th>\n",
       "      <td>2002-09-24</td>\n",
       "      <td>1.886272</td>\n",
       "      <td>34.543307</td>\n",
       "      <td>-6.644915</td>\n",
       "      <td>-15.213739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>998</th>\n",
       "      <td>2002-09-25</td>\n",
       "      <td>2.918438</td>\n",
       "      <td>33.722114</td>\n",
       "      <td>-5.736130</td>\n",
       "      <td>-14.919711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>999</th>\n",
       "      <td>2002-09-26</td>\n",
       "      <td>2.608268</td>\n",
       "      <td>33.473087</td>\n",
       "      <td>-5.111581</td>\n",
       "      <td>-15.969800</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "     Unnamed: 0         A          B         C          D\n",
       "0    2000-01-01 -0.547915   0.758504 -0.791553  -0.014276\n",
       "1    2000-01-02 -1.478652  -1.824863  0.001416  -1.067864\n",
       "2    2000-01-03 -3.070727  -1.655967 -0.551411  -2.188238\n",
       "3    2000-01-04 -3.317105  -1.810778  0.354000  -1.995760\n",
       "4    2000-01-05 -2.822308  -2.757077  1.210057  -1.250592\n",
       "5    2000-01-06 -2.223865  -3.256931  3.658672  -1.232510\n",
       "6    2000-01-07 -0.559411  -2.842820  4.860993  -0.418853\n",
       "7    2000-01-08 -0.524812  -2.748762  6.280814   0.170616\n",
       "8    2000-01-09  0.204528  -0.865022  5.560456   0.875871\n",
       "9    2000-01-10  0.688895  -1.704024  5.226062   0.444483\n",
       "10   2000-01-11  1.272138  -2.478377  2.763524  -1.229797\n",
       "11   2000-01-12  1.255657  -2.994073  2.869688   0.745504\n",
       "12   2000-01-13 -0.001803  -2.295823  2.738087   2.640307\n",
       "13   2000-01-14  0.144209  -0.926810  4.087308   0.164138\n",
       "14   2000-01-15  1.304811   0.625530  3.542700  -1.499446\n",
       "15   2000-01-16  0.682026   0.552441  3.201389  -0.155674\n",
       "16   2000-01-17 -1.065321  -0.339092  3.792634  -1.754946\n",
       "17   2000-01-18 -1.268418  -3.512773  3.656896  -0.132124\n",
       "18   2000-01-19 -1.936390  -1.069188  2.554887   0.413930\n",
       "19   2000-01-20 -1.138678  -2.993870  3.094198  -0.956574\n",
       "20   2000-01-21 -0.096721  -4.141108  3.341248  -0.436886\n",
       "21   2000-01-22 -0.678763  -5.012663  0.823576   1.303377\n",
       "22   2000-01-23 -2.498525  -6.075938  0.302908  -0.294204\n",
       "23   2000-01-24 -0.937785  -6.768487 -0.078521  -0.165799\n",
       "24   2000-01-25 -0.252338  -6.882860  0.545684  -1.108641\n",
       "25   2000-01-26 -0.772653  -7.080129  0.764647  -3.041450\n",
       "26   2000-01-27 -0.348831  -6.035375  0.507673  -2.522836\n",
       "27   2000-01-28  1.751721  -5.756738 -0.469014  -2.825118\n",
       "28   2000-01-29  0.799938  -4.559172 -0.086763  -3.243101\n",
       "29   2000-01-30  1.149650  -4.433331  1.476689  -2.479956\n",
       "..          ...       ...        ...       ...        ...\n",
       "970  2002-08-28  0.466756  38.780786 -6.743120 -15.206051\n",
       "971  2002-08-29  1.903199  36.687258 -5.720742 -14.335689\n",
       "972  2002-08-30  1.432801  37.186065 -6.274877 -14.879621\n",
       "973  2002-08-31  2.218021  36.200395 -5.638178 -15.625389\n",
       "974  2002-09-01  3.405318  36.987365 -4.441912 -14.162031\n",
       "975  2002-09-02  3.854252  38.283545 -4.845949 -15.449302\n",
       "976  2002-09-03  4.328033  37.123804 -6.006344 -14.158929\n",
       "977  2002-09-04  5.219103  37.203486 -6.035182 -14.461389\n",
       "978  2002-09-05  4.884547  38.192836 -6.447570 -13.541204\n",
       "979  2002-09-06  5.817435  37.669998 -5.983732 -12.238303\n",
       "980  2002-09-07  7.953334  37.503576 -4.783659 -12.092902\n",
       "981  2002-09-08  8.575181  37.377622 -3.154240 -12.895208\n",
       "982  2002-09-09  8.242240  38.155500 -3.285132 -13.483775\n",
       "983  2002-09-10  9.699693  37.421024 -1.763105 -13.397276\n",
       "984  2002-09-11  7.228027  38.070563 -1.250151 -14.455654\n",
       "985  2002-09-12  7.276336  38.503057 -1.110047 -15.362900\n",
       "986  2002-09-13  6.955453  37.038613 -0.571942 -14.527590\n",
       "987  2002-09-14  6.232800  37.254276 -1.893050 -14.385401\n",
       "988  2002-09-15  5.331802  36.671504 -1.782282 -13.645305\n",
       "989  2002-09-16  5.825638  36.920733 -2.718137 -13.875984\n",
       "990  2002-09-17  5.972137  36.785577 -3.923763 -13.281418\n",
       "991  2002-09-18  5.154685  34.789858 -4.426825 -13.805227\n",
       "992  2002-09-19  4.228035  34.400350 -4.431980 -14.520423\n",
       "993  2002-09-20  3.047640  36.244469 -5.093584 -15.106412\n",
       "994  2002-09-21  2.984361  38.095349 -5.560222 -16.584216\n",
       "995  2002-09-22  3.187098  37.169742 -6.132250 -14.910771\n",
       "996  2002-09-23  1.772470  36.399488 -6.257600 -13.668261\n",
       "997  2002-09-24  1.886272  34.543307 -6.644915 -15.213739\n",
       "998  2002-09-25  2.918438  33.722114 -5.736130 -14.919711\n",
       "999  2002-09-26  2.608268  33.473087 -5.111581 -15.969800\n",
       "\n",
       "[1000 rows x 5 columns]"
      ]
     },
     "execution_count": 102,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_csv('data/foo.csv')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## HDF5"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "HDFStores的读写"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "写入一个HDF5 Store"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 103,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_hdf('data/foo.h5', 'df')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从一个HDF5 Store读入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 104,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-01</th>\n",
       "      <td>-0.547915</td>\n",
       "      <td>0.758504</td>\n",
       "      <td>-0.791553</td>\n",
       "      <td>-0.014276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-02</th>\n",
       "      <td>-1.478652</td>\n",
       "      <td>-1.824863</td>\n",
       "      <td>0.001416</td>\n",
       "      <td>-1.067864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-03</th>\n",
       "      <td>-3.070727</td>\n",
       "      <td>-1.655967</td>\n",
       "      <td>-0.551411</td>\n",
       "      <td>-2.188238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-04</th>\n",
       "      <td>-3.317105</td>\n",
       "      <td>-1.810778</td>\n",
       "      <td>0.354000</td>\n",
       "      <td>-1.995760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>-2.822308</td>\n",
       "      <td>-2.757077</td>\n",
       "      <td>1.210057</td>\n",
       "      <td>-1.250592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>-2.223865</td>\n",
       "      <td>-3.256931</td>\n",
       "      <td>3.658672</td>\n",
       "      <td>-1.232510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-07</th>\n",
       "      <td>-0.559411</td>\n",
       "      <td>-2.842820</td>\n",
       "      <td>4.860993</td>\n",
       "      <td>-0.418853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-08</th>\n",
       "      <td>-0.524812</td>\n",
       "      <td>-2.748762</td>\n",
       "      <td>6.280814</td>\n",
       "      <td>0.170616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-09</th>\n",
       "      <td>0.204528</td>\n",
       "      <td>-0.865022</td>\n",
       "      <td>5.560456</td>\n",
       "      <td>0.875871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-10</th>\n",
       "      <td>0.688895</td>\n",
       "      <td>-1.704024</td>\n",
       "      <td>5.226062</td>\n",
       "      <td>0.444483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-11</th>\n",
       "      <td>1.272138</td>\n",
       "      <td>-2.478377</td>\n",
       "      <td>2.763524</td>\n",
       "      <td>-1.229797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>1.255657</td>\n",
       "      <td>-2.994073</td>\n",
       "      <td>2.869688</td>\n",
       "      <td>0.745504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-13</th>\n",
       "      <td>-0.001803</td>\n",
       "      <td>-2.295823</td>\n",
       "      <td>2.738087</td>\n",
       "      <td>2.640307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-14</th>\n",
       "      <td>0.144209</td>\n",
       "      <td>-0.926810</td>\n",
       "      <td>4.087308</td>\n",
       "      <td>0.164138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-15</th>\n",
       "      <td>1.304811</td>\n",
       "      <td>0.625530</td>\n",
       "      <td>3.542700</td>\n",
       "      <td>-1.499446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-16</th>\n",
       "      <td>0.682026</td>\n",
       "      <td>0.552441</td>\n",
       "      <td>3.201389</td>\n",
       "      <td>-0.155674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-17</th>\n",
       "      <td>-1.065321</td>\n",
       "      <td>-0.339092</td>\n",
       "      <td>3.792634</td>\n",
       "      <td>-1.754946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-18</th>\n",
       "      <td>-1.268418</td>\n",
       "      <td>-3.512773</td>\n",
       "      <td>3.656896</td>\n",
       "      <td>-0.132124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-19</th>\n",
       "      <td>-1.936390</td>\n",
       "      <td>-1.069188</td>\n",
       "      <td>2.554887</td>\n",
       "      <td>0.413930</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-20</th>\n",
       "      <td>-1.138678</td>\n",
       "      <td>-2.993870</td>\n",
       "      <td>3.094198</td>\n",
       "      <td>-0.956574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-21</th>\n",
       "      <td>-0.096721</td>\n",
       "      <td>-4.141108</td>\n",
       "      <td>3.341248</td>\n",
       "      <td>-0.436886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-22</th>\n",
       "      <td>-0.678763</td>\n",
       "      <td>-5.012663</td>\n",
       "      <td>0.823576</td>\n",
       "      <td>1.303377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-23</th>\n",
       "      <td>-2.498525</td>\n",
       "      <td>-6.075938</td>\n",
       "      <td>0.302908</td>\n",
       "      <td>-0.294204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-24</th>\n",
       "      <td>-0.937785</td>\n",
       "      <td>-6.768487</td>\n",
       "      <td>-0.078521</td>\n",
       "      <td>-0.165799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-25</th>\n",
       "      <td>-0.252338</td>\n",
       "      <td>-6.882860</td>\n",
       "      <td>0.545684</td>\n",
       "      <td>-1.108641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-26</th>\n",
       "      <td>-0.772653</td>\n",
       "      <td>-7.080129</td>\n",
       "      <td>0.764647</td>\n",
       "      <td>-3.041450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-27</th>\n",
       "      <td>-0.348831</td>\n",
       "      <td>-6.035375</td>\n",
       "      <td>0.507673</td>\n",
       "      <td>-2.522836</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-28</th>\n",
       "      <td>1.751721</td>\n",
       "      <td>-5.756738</td>\n",
       "      <td>-0.469014</td>\n",
       "      <td>-2.825118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-29</th>\n",
       "      <td>0.799938</td>\n",
       "      <td>-4.559172</td>\n",
       "      <td>-0.086763</td>\n",
       "      <td>-3.243101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-30</th>\n",
       "      <td>1.149650</td>\n",
       "      <td>-4.433331</td>\n",
       "      <td>1.476689</td>\n",
       "      <td>-2.479956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-28</th>\n",
       "      <td>0.466756</td>\n",
       "      <td>38.780786</td>\n",
       "      <td>-6.743120</td>\n",
       "      <td>-15.206051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-29</th>\n",
       "      <td>1.903199</td>\n",
       "      <td>36.687258</td>\n",
       "      <td>-5.720742</td>\n",
       "      <td>-14.335689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-30</th>\n",
       "      <td>1.432801</td>\n",
       "      <td>37.186065</td>\n",
       "      <td>-6.274877</td>\n",
       "      <td>-14.879621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-31</th>\n",
       "      <td>2.218021</td>\n",
       "      <td>36.200395</td>\n",
       "      <td>-5.638178</td>\n",
       "      <td>-15.625389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-01</th>\n",
       "      <td>3.405318</td>\n",
       "      <td>36.987365</td>\n",
       "      <td>-4.441912</td>\n",
       "      <td>-14.162031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-02</th>\n",
       "      <td>3.854252</td>\n",
       "      <td>38.283545</td>\n",
       "      <td>-4.845949</td>\n",
       "      <td>-15.449302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-03</th>\n",
       "      <td>4.328033</td>\n",
       "      <td>37.123804</td>\n",
       "      <td>-6.006344</td>\n",
       "      <td>-14.158929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-04</th>\n",
       "      <td>5.219103</td>\n",
       "      <td>37.203486</td>\n",
       "      <td>-6.035182</td>\n",
       "      <td>-14.461389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-05</th>\n",
       "      <td>4.884547</td>\n",
       "      <td>38.192836</td>\n",
       "      <td>-6.447570</td>\n",
       "      <td>-13.541204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-06</th>\n",
       "      <td>5.817435</td>\n",
       "      <td>37.669998</td>\n",
       "      <td>-5.983732</td>\n",
       "      <td>-12.238303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-07</th>\n",
       "      <td>7.953334</td>\n",
       "      <td>37.503576</td>\n",
       "      <td>-4.783659</td>\n",
       "      <td>-12.092902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-08</th>\n",
       "      <td>8.575181</td>\n",
       "      <td>37.377622</td>\n",
       "      <td>-3.154240</td>\n",
       "      <td>-12.895208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-09</th>\n",
       "      <td>8.242240</td>\n",
       "      <td>38.155500</td>\n",
       "      <td>-3.285132</td>\n",
       "      <td>-13.483775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-10</th>\n",
       "      <td>9.699693</td>\n",
       "      <td>37.421024</td>\n",
       "      <td>-1.763105</td>\n",
       "      <td>-13.397276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-11</th>\n",
       "      <td>7.228027</td>\n",
       "      <td>38.070563</td>\n",
       "      <td>-1.250151</td>\n",
       "      <td>-14.455654</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-12</th>\n",
       "      <td>7.276336</td>\n",
       "      <td>38.503057</td>\n",
       "      <td>-1.110047</td>\n",
       "      <td>-15.362900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-13</th>\n",
       "      <td>6.955453</td>\n",
       "      <td>37.038613</td>\n",
       "      <td>-0.571942</td>\n",
       "      <td>-14.527590</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-14</th>\n",
       "      <td>6.232800</td>\n",
       "      <td>37.254276</td>\n",
       "      <td>-1.893050</td>\n",
       "      <td>-14.385401</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-15</th>\n",
       "      <td>5.331802</td>\n",
       "      <td>36.671504</td>\n",
       "      <td>-1.782282</td>\n",
       "      <td>-13.645305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-16</th>\n",
       "      <td>5.825638</td>\n",
       "      <td>36.920733</td>\n",
       "      <td>-2.718137</td>\n",
       "      <td>-13.875984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-17</th>\n",
       "      <td>5.972137</td>\n",
       "      <td>36.785577</td>\n",
       "      <td>-3.923763</td>\n",
       "      <td>-13.281418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-18</th>\n",
       "      <td>5.154685</td>\n",
       "      <td>34.789858</td>\n",
       "      <td>-4.426825</td>\n",
       "      <td>-13.805227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-19</th>\n",
       "      <td>4.228035</td>\n",
       "      <td>34.400350</td>\n",
       "      <td>-4.431980</td>\n",
       "      <td>-14.520423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-20</th>\n",
       "      <td>3.047640</td>\n",
       "      <td>36.244469</td>\n",
       "      <td>-5.093584</td>\n",
       "      <td>-15.106412</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-21</th>\n",
       "      <td>2.984361</td>\n",
       "      <td>38.095349</td>\n",
       "      <td>-5.560222</td>\n",
       "      <td>-16.584216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-22</th>\n",
       "      <td>3.187098</td>\n",
       "      <td>37.169742</td>\n",
       "      <td>-6.132250</td>\n",
       "      <td>-14.910771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-23</th>\n",
       "      <td>1.772470</td>\n",
       "      <td>36.399488</td>\n",
       "      <td>-6.257600</td>\n",
       "      <td>-13.668261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-24</th>\n",
       "      <td>1.886272</td>\n",
       "      <td>34.543307</td>\n",
       "      <td>-6.644915</td>\n",
       "      <td>-15.213739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-25</th>\n",
       "      <td>2.918438</td>\n",
       "      <td>33.722114</td>\n",
       "      <td>-5.736130</td>\n",
       "      <td>-14.919711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-26</th>\n",
       "      <td>2.608268</td>\n",
       "      <td>33.473087</td>\n",
       "      <td>-5.111581</td>\n",
       "      <td>-15.969800</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A          B         C          D\n",
       "2000-01-01 -0.547915   0.758504 -0.791553  -0.014276\n",
       "2000-01-02 -1.478652  -1.824863  0.001416  -1.067864\n",
       "2000-01-03 -3.070727  -1.655967 -0.551411  -2.188238\n",
       "2000-01-04 -3.317105  -1.810778  0.354000  -1.995760\n",
       "2000-01-05 -2.822308  -2.757077  1.210057  -1.250592\n",
       "2000-01-06 -2.223865  -3.256931  3.658672  -1.232510\n",
       "2000-01-07 -0.559411  -2.842820  4.860993  -0.418853\n",
       "2000-01-08 -0.524812  -2.748762  6.280814   0.170616\n",
       "2000-01-09  0.204528  -0.865022  5.560456   0.875871\n",
       "2000-01-10  0.688895  -1.704024  5.226062   0.444483\n",
       "2000-01-11  1.272138  -2.478377  2.763524  -1.229797\n",
       "2000-01-12  1.255657  -2.994073  2.869688   0.745504\n",
       "2000-01-13 -0.001803  -2.295823  2.738087   2.640307\n",
       "2000-01-14  0.144209  -0.926810  4.087308   0.164138\n",
       "2000-01-15  1.304811   0.625530  3.542700  -1.499446\n",
       "2000-01-16  0.682026   0.552441  3.201389  -0.155674\n",
       "2000-01-17 -1.065321  -0.339092  3.792634  -1.754946\n",
       "2000-01-18 -1.268418  -3.512773  3.656896  -0.132124\n",
       "2000-01-19 -1.936390  -1.069188  2.554887   0.413930\n",
       "2000-01-20 -1.138678  -2.993870  3.094198  -0.956574\n",
       "2000-01-21 -0.096721  -4.141108  3.341248  -0.436886\n",
       "2000-01-22 -0.678763  -5.012663  0.823576   1.303377\n",
       "2000-01-23 -2.498525  -6.075938  0.302908  -0.294204\n",
       "2000-01-24 -0.937785  -6.768487 -0.078521  -0.165799\n",
       "2000-01-25 -0.252338  -6.882860  0.545684  -1.108641\n",
       "2000-01-26 -0.772653  -7.080129  0.764647  -3.041450\n",
       "2000-01-27 -0.348831  -6.035375  0.507673  -2.522836\n",
       "2000-01-28  1.751721  -5.756738 -0.469014  -2.825118\n",
       "2000-01-29  0.799938  -4.559172 -0.086763  -3.243101\n",
       "2000-01-30  1.149650  -4.433331  1.476689  -2.479956\n",
       "...              ...        ...       ...        ...\n",
       "2002-08-28  0.466756  38.780786 -6.743120 -15.206051\n",
       "2002-08-29  1.903199  36.687258 -5.720742 -14.335689\n",
       "2002-08-30  1.432801  37.186065 -6.274877 -14.879621\n",
       "2002-08-31  2.218021  36.200395 -5.638178 -15.625389\n",
       "2002-09-01  3.405318  36.987365 -4.441912 -14.162031\n",
       "2002-09-02  3.854252  38.283545 -4.845949 -15.449302\n",
       "2002-09-03  4.328033  37.123804 -6.006344 -14.158929\n",
       "2002-09-04  5.219103  37.203486 -6.035182 -14.461389\n",
       "2002-09-05  4.884547  38.192836 -6.447570 -13.541204\n",
       "2002-09-06  5.817435  37.669998 -5.983732 -12.238303\n",
       "2002-09-07  7.953334  37.503576 -4.783659 -12.092902\n",
       "2002-09-08  8.575181  37.377622 -3.154240 -12.895208\n",
       "2002-09-09  8.242240  38.155500 -3.285132 -13.483775\n",
       "2002-09-10  9.699693  37.421024 -1.763105 -13.397276\n",
       "2002-09-11  7.228027  38.070563 -1.250151 -14.455654\n",
       "2002-09-12  7.276336  38.503057 -1.110047 -15.362900\n",
       "2002-09-13  6.955453  37.038613 -0.571942 -14.527590\n",
       "2002-09-14  6.232800  37.254276 -1.893050 -14.385401\n",
       "2002-09-15  5.331802  36.671504 -1.782282 -13.645305\n",
       "2002-09-16  5.825638  36.920733 -2.718137 -13.875984\n",
       "2002-09-17  5.972137  36.785577 -3.923763 -13.281418\n",
       "2002-09-18  5.154685  34.789858 -4.426825 -13.805227\n",
       "2002-09-19  4.228035  34.400350 -4.431980 -14.520423\n",
       "2002-09-20  3.047640  36.244469 -5.093584 -15.106412\n",
       "2002-09-21  2.984361  38.095349 -5.560222 -16.584216\n",
       "2002-09-22  3.187098  37.169742 -6.132250 -14.910771\n",
       "2002-09-23  1.772470  36.399488 -6.257600 -13.668261\n",
       "2002-09-24  1.886272  34.543307 -6.644915 -15.213739\n",
       "2002-09-25  2.918438  33.722114 -5.736130 -14.919711\n",
       "2002-09-26  2.608268  33.473087 -5.111581 -15.969800\n",
       "\n",
       "[1000 rows x 4 columns]"
      ]
     },
     "execution_count": 104,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_hdf('data/foo.h5', 'df')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Excel"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "MS Excel的读写"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "写入一个Excel文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 105,
   "metadata": {},
   "outputs": [],
   "source": [
    "df.to_excel('data/foo.xlsx', sheet_name='Sheet1')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从一个excel文件读入"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 106,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>A</th>\n",
       "      <th>B</th>\n",
       "      <th>C</th>\n",
       "      <th>D</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>2000-01-01</th>\n",
       "      <td>-0.547915</td>\n",
       "      <td>0.758504</td>\n",
       "      <td>-0.791553</td>\n",
       "      <td>-0.014276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-02</th>\n",
       "      <td>-1.478652</td>\n",
       "      <td>-1.824863</td>\n",
       "      <td>0.001416</td>\n",
       "      <td>-1.067864</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-03</th>\n",
       "      <td>-3.070727</td>\n",
       "      <td>-1.655967</td>\n",
       "      <td>-0.551411</td>\n",
       "      <td>-2.188238</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-04</th>\n",
       "      <td>-3.317105</td>\n",
       "      <td>-1.810778</td>\n",
       "      <td>0.354000</td>\n",
       "      <td>-1.995760</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-05</th>\n",
       "      <td>-2.822308</td>\n",
       "      <td>-2.757077</td>\n",
       "      <td>1.210057</td>\n",
       "      <td>-1.250592</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-06</th>\n",
       "      <td>-2.223865</td>\n",
       "      <td>-3.256931</td>\n",
       "      <td>3.658672</td>\n",
       "      <td>-1.232510</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-07</th>\n",
       "      <td>-0.559411</td>\n",
       "      <td>-2.842820</td>\n",
       "      <td>4.860993</td>\n",
       "      <td>-0.418853</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-08</th>\n",
       "      <td>-0.524812</td>\n",
       "      <td>-2.748762</td>\n",
       "      <td>6.280814</td>\n",
       "      <td>0.170616</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-09</th>\n",
       "      <td>0.204528</td>\n",
       "      <td>-0.865022</td>\n",
       "      <td>5.560456</td>\n",
       "      <td>0.875871</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-10</th>\n",
       "      <td>0.688895</td>\n",
       "      <td>-1.704024</td>\n",
       "      <td>5.226062</td>\n",
       "      <td>0.444483</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-11</th>\n",
       "      <td>1.272138</td>\n",
       "      <td>-2.478377</td>\n",
       "      <td>2.763524</td>\n",
       "      <td>-1.229797</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-12</th>\n",
       "      <td>1.255657</td>\n",
       "      <td>-2.994073</td>\n",
       "      <td>2.869688</td>\n",
       "      <td>0.745504</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-13</th>\n",
       "      <td>-0.001803</td>\n",
       "      <td>-2.295823</td>\n",
       "      <td>2.738087</td>\n",
       "      <td>2.640307</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-14</th>\n",
       "      <td>0.144209</td>\n",
       "      <td>-0.926810</td>\n",
       "      <td>4.087308</td>\n",
       "      <td>0.164138</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-15</th>\n",
       "      <td>1.304811</td>\n",
       "      <td>0.625530</td>\n",
       "      <td>3.542700</td>\n",
       "      <td>-1.499446</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-16</th>\n",
       "      <td>0.682026</td>\n",
       "      <td>0.552441</td>\n",
       "      <td>3.201389</td>\n",
       "      <td>-0.155674</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-17</th>\n",
       "      <td>-1.065321</td>\n",
       "      <td>-0.339092</td>\n",
       "      <td>3.792634</td>\n",
       "      <td>-1.754946</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-18</th>\n",
       "      <td>-1.268418</td>\n",
       "      <td>-3.512773</td>\n",
       "      <td>3.656896</td>\n",
       "      <td>-0.132124</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-19</th>\n",
       "      <td>-1.936390</td>\n",
       "      <td>-1.069188</td>\n",
       "      <td>2.554887</td>\n",
       "      <td>0.413930</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-20</th>\n",
       "      <td>-1.138678</td>\n",
       "      <td>-2.993870</td>\n",
       "      <td>3.094198</td>\n",
       "      <td>-0.956574</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-21</th>\n",
       "      <td>-0.096721</td>\n",
       "      <td>-4.141108</td>\n",
       "      <td>3.341248</td>\n",
       "      <td>-0.436886</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-22</th>\n",
       "      <td>-0.678763</td>\n",
       "      <td>-5.012663</td>\n",
       "      <td>0.823576</td>\n",
       "      <td>1.303377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-23</th>\n",
       "      <td>-2.498525</td>\n",
       "      <td>-6.075938</td>\n",
       "      <td>0.302908</td>\n",
       "      <td>-0.294204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-24</th>\n",
       "      <td>-0.937785</td>\n",
       "      <td>-6.768487</td>\n",
       "      <td>-0.078521</td>\n",
       "      <td>-0.165799</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-25</th>\n",
       "      <td>-0.252338</td>\n",
       "      <td>-6.882860</td>\n",
       "      <td>0.545684</td>\n",
       "      <td>-1.108641</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-26</th>\n",
       "      <td>-0.772653</td>\n",
       "      <td>-7.080129</td>\n",
       "      <td>0.764647</td>\n",
       "      <td>-3.041450</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-27</th>\n",
       "      <td>-0.348831</td>\n",
       "      <td>-6.035375</td>\n",
       "      <td>0.507673</td>\n",
       "      <td>-2.522836</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-28</th>\n",
       "      <td>1.751721</td>\n",
       "      <td>-5.756738</td>\n",
       "      <td>-0.469014</td>\n",
       "      <td>-2.825118</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-29</th>\n",
       "      <td>0.799938</td>\n",
       "      <td>-4.559172</td>\n",
       "      <td>-0.086763</td>\n",
       "      <td>-3.243101</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2000-01-30</th>\n",
       "      <td>1.149650</td>\n",
       "      <td>-4.433331</td>\n",
       "      <td>1.476689</td>\n",
       "      <td>-2.479956</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-28</th>\n",
       "      <td>0.466756</td>\n",
       "      <td>38.780786</td>\n",
       "      <td>-6.743120</td>\n",
       "      <td>-15.206051</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-29</th>\n",
       "      <td>1.903199</td>\n",
       "      <td>36.687258</td>\n",
       "      <td>-5.720742</td>\n",
       "      <td>-14.335689</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-30</th>\n",
       "      <td>1.432801</td>\n",
       "      <td>37.186065</td>\n",
       "      <td>-6.274877</td>\n",
       "      <td>-14.879621</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-08-31</th>\n",
       "      <td>2.218021</td>\n",
       "      <td>36.200395</td>\n",
       "      <td>-5.638178</td>\n",
       "      <td>-15.625389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-01</th>\n",
       "      <td>3.405318</td>\n",
       "      <td>36.987365</td>\n",
       "      <td>-4.441912</td>\n",
       "      <td>-14.162031</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-02</th>\n",
       "      <td>3.854252</td>\n",
       "      <td>38.283545</td>\n",
       "      <td>-4.845949</td>\n",
       "      <td>-15.449302</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-03</th>\n",
       "      <td>4.328033</td>\n",
       "      <td>37.123804</td>\n",
       "      <td>-6.006344</td>\n",
       "      <td>-14.158929</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-04</th>\n",
       "      <td>5.219103</td>\n",
       "      <td>37.203486</td>\n",
       "      <td>-6.035182</td>\n",
       "      <td>-14.461389</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-05</th>\n",
       "      <td>4.884547</td>\n",
       "      <td>38.192836</td>\n",
       "      <td>-6.447570</td>\n",
       "      <td>-13.541204</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-06</th>\n",
       "      <td>5.817435</td>\n",
       "      <td>37.669998</td>\n",
       "      <td>-5.983732</td>\n",
       "      <td>-12.238303</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-07</th>\n",
       "      <td>7.953334</td>\n",
       "      <td>37.503576</td>\n",
       "      <td>-4.783659</td>\n",
       "      <td>-12.092902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-08</th>\n",
       "      <td>8.575181</td>\n",
       "      <td>37.377622</td>\n",
       "      <td>-3.154240</td>\n",
       "      <td>-12.895208</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-09</th>\n",
       "      <td>8.242240</td>\n",
       "      <td>38.155500</td>\n",
       "      <td>-3.285132</td>\n",
       "      <td>-13.483775</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-10</th>\n",
       "      <td>9.699693</td>\n",
       "      <td>37.421024</td>\n",
       "      <td>-1.763105</td>\n",
       "      <td>-13.397276</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-11</th>\n",
       "      <td>7.228027</td>\n",
       "      <td>38.070563</td>\n",
       "      <td>-1.250151</td>\n",
       "      <td>-14.455654</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-12</th>\n",
       "      <td>7.276336</td>\n",
       "      <td>38.503057</td>\n",
       "      <td>-1.110047</td>\n",
       "      <td>-15.362900</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-13</th>\n",
       "      <td>6.955453</td>\n",
       "      <td>37.038613</td>\n",
       "      <td>-0.571942</td>\n",
       "      <td>-14.527590</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-14</th>\n",
       "      <td>6.232800</td>\n",
       "      <td>37.254276</td>\n",
       "      <td>-1.893050</td>\n",
       "      <td>-14.385401</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-15</th>\n",
       "      <td>5.331802</td>\n",
       "      <td>36.671504</td>\n",
       "      <td>-1.782282</td>\n",
       "      <td>-13.645305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-16</th>\n",
       "      <td>5.825638</td>\n",
       "      <td>36.920733</td>\n",
       "      <td>-2.718137</td>\n",
       "      <td>-13.875984</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-17</th>\n",
       "      <td>5.972137</td>\n",
       "      <td>36.785577</td>\n",
       "      <td>-3.923763</td>\n",
       "      <td>-13.281418</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-18</th>\n",
       "      <td>5.154685</td>\n",
       "      <td>34.789858</td>\n",
       "      <td>-4.426825</td>\n",
       "      <td>-13.805227</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-19</th>\n",
       "      <td>4.228035</td>\n",
       "      <td>34.400350</td>\n",
       "      <td>-4.431980</td>\n",
       "      <td>-14.520423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-20</th>\n",
       "      <td>3.047640</td>\n",
       "      <td>36.244469</td>\n",
       "      <td>-5.093584</td>\n",
       "      <td>-15.106412</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-21</th>\n",
       "      <td>2.984361</td>\n",
       "      <td>38.095349</td>\n",
       "      <td>-5.560222</td>\n",
       "      <td>-16.584216</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-22</th>\n",
       "      <td>3.187098</td>\n",
       "      <td>37.169742</td>\n",
       "      <td>-6.132250</td>\n",
       "      <td>-14.910771</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-23</th>\n",
       "      <td>1.772470</td>\n",
       "      <td>36.399488</td>\n",
       "      <td>-6.257600</td>\n",
       "      <td>-13.668261</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-24</th>\n",
       "      <td>1.886272</td>\n",
       "      <td>34.543307</td>\n",
       "      <td>-6.644915</td>\n",
       "      <td>-15.213739</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-25</th>\n",
       "      <td>2.918438</td>\n",
       "      <td>33.722114</td>\n",
       "      <td>-5.736130</td>\n",
       "      <td>-14.919711</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2002-09-26</th>\n",
       "      <td>2.608268</td>\n",
       "      <td>33.473087</td>\n",
       "      <td>-5.111581</td>\n",
       "      <td>-15.969800</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1000 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                   A          B         C          D\n",
       "2000-01-01 -0.547915   0.758504 -0.791553  -0.014276\n",
       "2000-01-02 -1.478652  -1.824863  0.001416  -1.067864\n",
       "2000-01-03 -3.070727  -1.655967 -0.551411  -2.188238\n",
       "2000-01-04 -3.317105  -1.810778  0.354000  -1.995760\n",
       "2000-01-05 -2.822308  -2.757077  1.210057  -1.250592\n",
       "2000-01-06 -2.223865  -3.256931  3.658672  -1.232510\n",
       "2000-01-07 -0.559411  -2.842820  4.860993  -0.418853\n",
       "2000-01-08 -0.524812  -2.748762  6.280814   0.170616\n",
       "2000-01-09  0.204528  -0.865022  5.560456   0.875871\n",
       "2000-01-10  0.688895  -1.704024  5.226062   0.444483\n",
       "2000-01-11  1.272138  -2.478377  2.763524  -1.229797\n",
       "2000-01-12  1.255657  -2.994073  2.869688   0.745504\n",
       "2000-01-13 -0.001803  -2.295823  2.738087   2.640307\n",
       "2000-01-14  0.144209  -0.926810  4.087308   0.164138\n",
       "2000-01-15  1.304811   0.625530  3.542700  -1.499446\n",
       "2000-01-16  0.682026   0.552441  3.201389  -0.155674\n",
       "2000-01-17 -1.065321  -0.339092  3.792634  -1.754946\n",
       "2000-01-18 -1.268418  -3.512773  3.656896  -0.132124\n",
       "2000-01-19 -1.936390  -1.069188  2.554887   0.413930\n",
       "2000-01-20 -1.138678  -2.993870  3.094198  -0.956574\n",
       "2000-01-21 -0.096721  -4.141108  3.341248  -0.436886\n",
       "2000-01-22 -0.678763  -5.012663  0.823576   1.303377\n",
       "2000-01-23 -2.498525  -6.075938  0.302908  -0.294204\n",
       "2000-01-24 -0.937785  -6.768487 -0.078521  -0.165799\n",
       "2000-01-25 -0.252338  -6.882860  0.545684  -1.108641\n",
       "2000-01-26 -0.772653  -7.080129  0.764647  -3.041450\n",
       "2000-01-27 -0.348831  -6.035375  0.507673  -2.522836\n",
       "2000-01-28  1.751721  -5.756738 -0.469014  -2.825118\n",
       "2000-01-29  0.799938  -4.559172 -0.086763  -3.243101\n",
       "2000-01-30  1.149650  -4.433331  1.476689  -2.479956\n",
       "...              ...        ...       ...        ...\n",
       "2002-08-28  0.466756  38.780786 -6.743120 -15.206051\n",
       "2002-08-29  1.903199  36.687258 -5.720742 -14.335689\n",
       "2002-08-30  1.432801  37.186065 -6.274877 -14.879621\n",
       "2002-08-31  2.218021  36.200395 -5.638178 -15.625389\n",
       "2002-09-01  3.405318  36.987365 -4.441912 -14.162031\n",
       "2002-09-02  3.854252  38.283545 -4.845949 -15.449302\n",
       "2002-09-03  4.328033  37.123804 -6.006344 -14.158929\n",
       "2002-09-04  5.219103  37.203486 -6.035182 -14.461389\n",
       "2002-09-05  4.884547  38.192836 -6.447570 -13.541204\n",
       "2002-09-06  5.817435  37.669998 -5.983732 -12.238303\n",
       "2002-09-07  7.953334  37.503576 -4.783659 -12.092902\n",
       "2002-09-08  8.575181  37.377622 -3.154240 -12.895208\n",
       "2002-09-09  8.242240  38.155500 -3.285132 -13.483775\n",
       "2002-09-10  9.699693  37.421024 -1.763105 -13.397276\n",
       "2002-09-11  7.228027  38.070563 -1.250151 -14.455654\n",
       "2002-09-12  7.276336  38.503057 -1.110047 -15.362900\n",
       "2002-09-13  6.955453  37.038613 -0.571942 -14.527590\n",
       "2002-09-14  6.232800  37.254276 -1.893050 -14.385401\n",
       "2002-09-15  5.331802  36.671504 -1.782282 -13.645305\n",
       "2002-09-16  5.825638  36.920733 -2.718137 -13.875984\n",
       "2002-09-17  5.972137  36.785577 -3.923763 -13.281418\n",
       "2002-09-18  5.154685  34.789858 -4.426825 -13.805227\n",
       "2002-09-19  4.228035  34.400350 -4.431980 -14.520423\n",
       "2002-09-20  3.047640  36.244469 -5.093584 -15.106412\n",
       "2002-09-21  2.984361  38.095349 -5.560222 -16.584216\n",
       "2002-09-22  3.187098  37.169742 -6.132250 -14.910771\n",
       "2002-09-23  1.772470  36.399488 -6.257600 -13.668261\n",
       "2002-09-24  1.886272  34.543307 -6.644915 -15.213739\n",
       "2002-09-25  2.918438  33.722114 -5.736130 -14.919711\n",
       "2002-09-26  2.608268  33.473087 -5.111581 -15.969800\n",
       "\n",
       "[1000 rows x 4 columns]"
      ]
     },
     "execution_count": 106,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_excel('data/foo.xlsx', 'Sheet1', index_col=None, na_values=['NA'])"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
